Move Zeros to the End
Move all zeros to the end while keeping the order of the other elements.
Input
, then integers.
Output
The rearranged array.
Constraints
Sample 1
Input
5 0 1 0 3 12
Output
1 3 12 0 0
Move all zeros to the end while keeping the order of the other elements.
, then integers.
The rearranged array.
Input
5 0 1 0 3 12
Output
1 3 12 0 0