{"ScriptPreparationCode":null,"TestCases":[{"Name":"A","Code":"var firstMissingPositive = function(nums) {\r\n nums = nums.sort(function(val1, val2) {\r\n return val1\u003Eval2?1:val1\u003Cval2?-1:0; \r\n });\r\n if(nums.length===0||nums[nums.length-1]\u003C=0){ return 1; } // A, B\r\n for(var i=0,k=1; i\u003Cnums.length; \u002B\u002Bi){ // C\r\n if(nums[i]\u003Ek){ return k; }\r\n k = nums[i]\u003Ck?k:k\u002B1;\r\n }\r\n return nums[nums.length-1]\u002B1; // D\r\n};","IsDeferred":false},{"Name":"V","Code":"var firstMissingPositive = function (nums) {\r\n let s = 1;\r\n let i = 0;\r\n let w = false;\r\n do {\r\n w = false;\r\n for (i = 0; i \u003C nums.length; i\u002B\u002B) {\r\n if (s == nums[i]) {\r\n s\u002B\u002B;\r\n w = true;\r\n }\r\n }\r\n } while (w == true)\r\n return s\r\n };","IsDeferred":false}]}