407. Move Zeroes
Given an array A, create a function that moves all occurrences of the number 0 to the end of the array while preserving the relative order of the non-zero elements.
The first line of input contains an integer n, which represents the size of the array. The next n lines contain a single integer each, representing the elements of the array.
Print the resulting array.
5 0 1 0 3 12
1 3 12 0 0
Note: Perform this operation in-place without creating a duplicate array and minimize the total number of operations.