{"ScriptPreparationCode":" function searchMostCommonNumber(arr) {\r\n if (arr === void 0) {\r\n arr = [];\r\n }\r\n var current = 0;\r\n var max = 0;\r\n var mostCommonNumber = 0;\r\n var i;\r\n for (i = 0; i \u003C arr.length - 1; i\u002B\u002B) {\r\n var current_1 = 1;\r\n var j = void 0;\r\n for (j = i \u002B 1; j \u003C arr.length; j\u002B\u002B) {\r\n if (arr[i] === arr[j]) {\r\n current_1\u002B\u002B;\r\n }\r\n }\r\n if (current_1 \u003E max) {\r\n max = current_1;\r\n mostCommonNumber = arr[i];\r\n }\r\n }\r\n return mostCommonNumber;\r\n }\r\n\r\n\r\nfunction mostCommonNumber(numbers) {\r\n let map = new Map()\r\n for (let num of numbers) {\r\n map.set(num, (map.get(num) || 0) \u002B 1)\r\n }\r\n\r\n let mostCommonNumber = NaN\r\n let maxCount = -1\r\n for (let [num, count] of map.entries()) {\r\n if (count \u003E maxCount) {\r\n maxCount = count\r\n mostCommonNumber = num\r\n }\r\n }\r\n\r\n return mostCommonNumber\r\n}\r\n\r\nnumbers = Array(1e2).map(n =\u003E Math.floor(Math.random() * 1000))","TestCases":[{"Name":"searchMostCommonNumber","Code":"searchMostCommonNumber(numbers)","IsDeferred":false},{"Name":"mostCommonNumber","Code":"mostCommonNumber(numbers)","IsDeferred":false}]}