nums
, move all zeroes to the front of it while maintaining the relative order of the non-zero elements.
moveZeroes([0, -1, 0, 3, 12]) → [0, 0, -1, 3, 12]
moveZeroes([1, 2, 3]) → [1, 2, 3]
moveZeroes([0, 0]) → [0, 0]
😳 TIME LEFT: seconds 😳
function moveZeroes(nums) {
}
⏰ TOTAL TIME: seconds ⏰