Given an array of integers, move every 0 to the end while keeping the relative order of the non-zero elements the same, all done in place.
Example 1
Explanation: Every non-zero value keeps its original relative order; the three zeros are pushed to the end.
Example 2
Explanation: No non-zero values exist, so the array is unchanged.
Example 3
Explanation: No zeros exist, so nothing moves.
Can you minimize the total number of swaps performed on elements that are already in their correct final position?
Code execution is coming soon.