The other solution is correct given the description, but almost every single time I've seen this question the requirement is that you maintain the relative order of the rest of the elements. It's still very simple, keep a counter going forward noting how many zeroes you have countered, move each non-zero element backwords by that many, and once you hit the end, fill from the last overwritten index onwards with zeroes.
[1, 0, 2, 0, 3]
Loop thru index of array
1. [1, 0, 2, 0, 3] - the first element is put into 0 index before it
2. [1, 0, 2, 0, 3] - counter = 1
3. [1, 2, 2, 0, 3] - the 3rd element is put into 1 index before it
4. [1, 2, 2, 0, 3] - counter = 2
5. [1, 2, 3, 0, 3] - the 5th element is put into 2 index before it
Reached end, start feeling zeroes from end - counter
4. [1, 2, 3, 0, 3] - lucky 0
5. [1, 2, 3, 0, 0] - done