{"ScriptPreparationCode":null,"TestCases":[{"Name":"case 1","Code":"const items = [3, -1, -2, 100, -2, -2, -1, 0, 100, 0, 3, 5, 2, 4, 1, 2, 3, 4, 4, 9, 4, 5, 5, 6, 7];\r\n\r\nconst result = [];\r\nitems.forEach(num =\u003E {\r\n while (result.includes(num)) num\u002B\u002B;\r\n result.push(num);\r\n});","IsDeferred":false},{"Name":"case 2","Code":"const result = [];\r\nconst items = [3, -1, -2, 100, -2, -2, -1, 0, 100, 0, 3, 5, 2, 4, 1, 2, 3, 4, 4, 9, 4, 5, 5, 6, 7];\r\nlet last = null;\r\n\r\nitems\r\n .sort((a, b) =\u003E a - b)\r\n .forEach(item =\u003E {\r\n const shouldIncrement = (last !== null \u0026\u0026 item \u003C= last)\r\n const uniqueNumber = (last = shouldIncrement ? last \u002B 1 : item);\r\n\r\n result.push(uniqueNumber);\r\n }, 0);","IsDeferred":false}]}