Loading...
Loading...
Loading...
A report has 0 for missing readings. Move every 0 to the end of the list and keep the other readings in their original order. Print the new list.
Example
Input
5 0 1 0 3 12
Output
1 3 12 0 0
1, 3, 12 keep their order.
Try the problem first. Open one hint at a time.
Collect the non-zero readings first, in order.
Then add as many zeros as were removed.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor