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