The TransCompilator

Solved LeetCode program · 223 of 1,000

#0283 · Move Zeroes

Easy Array chunk-05.md

Original English source

The numbers is a list of 0, 1, 0, 3, and 12. The result is an empty list of whole numbers. The zeros is 0.
For each value in numbers.
If value is not 0, Place value into result. If value is 0, add 1 to zeros.

Repeat while zeros is more than 0.
Place 0 into result. Subtract 1 from zeros.

For each value in result, show value.

Open in Playground Browse all 1,000 problems

Expected stdout

1
3
12
0
0