{"ScriptPreparationCode":"/*your preparation JavaScript code goes here\r\nTo execute async code during the script preparation, wrap it as function globalMeasureThatScriptPrepareFunction, example:*/\r\nasync function globalMeasureThatScriptPrepareFunction() {\r\n // This function is optional, feel free to remove it.\r\n // await someThing();\r\n}","TestCases":[{"Name":"copy","Code":"var getConcatenation = function(nums) {\r\n let ans = [];\r\n for (i = 0; i \u003C nums.length; i\u002B\u002B) {\r\n ans[i] = nums[i];\r\n ans[i \u002B nums.length] = nums[i];\r\n } \r\n\r\n return ans;\r\n};\r\n\r\nlet largeArray = Array.from({ length: 10_000_000 }, (_, i) =\u003E i);\r\ngetConcatenation(largeArray);","IsDeferred":false},{"Name":"concat","Code":"var getConcatenation = function (nums) {\r\n return nums.concat(nums);\r\n};\r\n\r\nlet largeArray = Array.from({ length: 10_000_000 }, (_, i) =\u003E i);\r\ngetConcatenation(largeArray);","IsDeferred":false},{"Name":"in place","Code":"var getConcatenation = function(nums) {\r\n const len = nums.length;\r\n for (i = 0; i \u003C len; i\u002B\u002B) {\r\n nums[i \u002B len] = nums[i];\r\n } \r\n\r\n return nums;\r\n};\r\n\r\nlet largeArray = Array.from({ length: 10_000_000 }, (_, i) =\u003E i);\r\ngetConcatenation(largeArray);","IsDeferred":false},{"Name":"Spread operator","Code":"/**\r\n * @param {number[]} nums\r\n * @return {number[]}\r\n */\r\nvar getConcatenation = function (nums) {\r\n return [...nums, ...nums];\r\n};\r\n\r\nlet largeArray = Array.from({ length: 10_000_000 }, (_, i) =\u003E i);\r\ngetConcatenation(largeArray);","IsDeferred":false}]}