{"ScriptPreparationCode":null,"TestCases":[{"Name":"Spread","Code":"return [...new Set([1, 2, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7])]","IsDeferred":false},{"Name":"use lodash","Code":"return _.uniq([1, 2, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7]);","IsDeferred":false},{"Name":"Array.from","Code":"return Array.from( new Set([1, 2, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7]) );","IsDeferred":false},{"Name":"For","Code":"const visited = {};\r\nconst uniques = [];\r\nconst initial = [1, 2, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7];\r\nfor(let i=0;i\u003Cinitial.lenght;i\u002B\u002B){\r\n if(!visited[initial[i]]) {\r\n visited[initial[i]] = true;\r\n uniques.push(initial[i]);\r\n }\r\n}\r\nreturn uniques","IsDeferred":false},{"Name":"For memory optimized","Code":"const visited = {};\r\nconst uniques = [];\r\nconst initial = [1, 2, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7];\r\nfor(let i=0;i\u003Cinitial.lenght;i\u002B\u002B){\r\n if(!(initial[i] in visited)) {\r\n visited[initial[i]] = undefined;\r\n uniques.push(initial[i]);\r\n }\r\n}\r\nreturn uniques","IsDeferred":false}]}