We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No description provided.
The text was updated successfully, but these errors were encountered:
/** * @param {number[]} nums * @return {void} Do not return anything, modify nums in-place instead. */ var moveZeroes = function(nums) { if(nums.length <= 1) return let left = 0, right = 0, n = nums.length while(right < n){ //思路简单,right指针找到所有不为0的数,赋值给left,这样left左边的数都是非零数 if(nums[right] !== 0){ nums[left] = nums[right] left++ } right++ } while(left < n){ nums[left++] = 0 } };
Sorry, something went wrong.
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: