{"ScriptPreparationCode":null,"TestCases":[{"Name":"first item after reverse","Code":"array.forEach(n =\u003E {\r\n const repeat = Math.sqrt(n);\r\n const result = [[], []];\r\n\r\n for (let i = 1; i \u003C= repeat; i\u002B\u002B) { \r\n if(n % i === 0) {\r\n result.push(i);\r\n if (i !== repeat) result.push(n / i);\r\n }\r\n }\r\n\r\n result.sort().reverse()[0]\r\n }\r\n)","IsDeferred":false},{"Name":"last item after sort","Code":"array.forEach(n =\u003E {\r\n const repeat = Math.sqrt(n);\r\n const result = [[], []];\r\n\r\n for (let i = 1; i \u003C= repeat; i\u002B\u002B) { \r\n if(n % i === 0) {\r\n result.push(i);\r\n if (i !== repeat) result.push(n / i);\r\n }\r\n }\r\n\r\n result.sort()[result.length-1]\r\n }\r\n)","IsDeferred":false}]}