Given an integer array nums, move all 0s to the end of it while maintaining the relative order of the non-zero elements.
Note: You must do this in-place without making a copy of the array. Print the modified array (return None).
Input: nums = [0, 1, 0, 3, 12] Output: [1, 3, 12, 0, 0] Explanation: Non-zero elements [1, 3, 12] retain their relative order; the two zeros are pushed to the end.
Input: nums = [0] Output: [0] Explanation: Single zero; already at the end.
Input: nums = [1] Output: [1] Explanation: No zeros to move.
nums = [0, 1, 0, 3, 12]