Created
June 21, 2018 03:00
-
-
Save basekays/bed3b6d1f8aae9f0565ee39b070515a0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @param {number[]} nums | |
| * @return {void} Do not return anything, modify nums in-place instead. | |
| */ | |
| var moveZeroes = function(nums) { | |
| for (var i = nums.length; i >= 0; i--) { | |
| if (nums[i] == 0) { | |
| nums.splice(i, 1); | |
| nums.push(0); | |
| } | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment