{"ScriptPreparationCode":"var length = 100000;\r\nlet added = [];\r\nvar array = new Array(length / 2).fill().map(() =\u003E {\r\n let number = Math.round(Math.random() * length);\r\n do {number = Math.round(Math.random() * length)} while (added.includes(number));\r\n added.push(number);\r\n return number;\r\n});\r\narray = array.concat(array);\r\narray.splice(Math.round(Math.random() * length), 1);\r\nvar sorted1 = [...array]\r\nvar sorted2 = [...array]\r\nvar sum = ((a, b) =\u003E a \u002B b)\r\nvar i","TestCases":[{"Name":"Sorted Compare","Code":"sorted1.sort()\r\nlet found, index\r\nfor(index = 0; index \u003C sorted1.length; index\u002B=2){\r\n\tif(sorted1[index] !== sorted1[index\u002B1]){\r\n \tfound = sorted1[index]\r\n \tbreak;\r\n }\r\n}","IsDeferred":false},{"Name":"Object","Code":"let tempObj = {}\r\narray.forEach((v) =\u003E {\r\n if(tempObj[v]) delete tempObj[v]\r\n else tempObj[v]= 1\r\n})","IsDeferred":false},{"Name":"Map","Code":"let tempMap = new Map()\r\narray.forEach((v) =\u003E {\r\n if(tempMap.has(v)) tempMap.delete(v)\r\n else tempMap.set(v, 1)\r\n})","IsDeferred":false},{"Name":"Sorted indexOf Splice","Code":"let temp = []\r\nlet foundIndex\r\nsorted2.sort()\r\nsorted2.forEach((v) =\u003E {\r\n foundIndex = temp.indexOf(v)\r\n if(foundIndex \u003E -1) temp.splice(foundIndex,1)\r\n else temp.push(v) \r\n})","IsDeferred":false},{"Name":"Set Sum","Code":"let mySet = new Set([...array])\r\nlet answer = (2*[...mySet.values()].reduce(sum, 0)) - (array.reduce(sum, 0))","IsDeferred":false},{"Name":"XOR","Code":"let res = array[0];\r\nfor (i = 1; i \u003C array.length; i\u002B\u002B) res = res ^ array[i]","IsDeferred":false}]}