Reorder a list in-place so all zeros are at the end while keeping the relative order of non-zero elements.
Constraints
Example
>>> nums = [0, 1, 0, 3, 12] >>> result = move_zeros_to_end(nums) >>> result is nums True >>> nums [1, 3, 12, 0, 0] >>> nums = [0, 0, 0] >>> move_zeros_to_end(nums) [0, 0, 0]
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints