Given an integer array nums, move all zeros to the end while maintaining the relative order of all non-zero elements.
You must do this in-place without making a copy of the array.
Input: An integer array nums of length n.
Output: The same array with zeros at the end and non-zeros in original relative order.
Input: [0,1,0,3,12]
Output: [1,3,12,0,0]
Explanation: Non-zeros in order: [1,3,12]. Zeros fill the tail. Result: [1,3,12,0,0].Input: [0,0,1]
Output: [1,0,0]
Explanation: Non-zero: [1]. Two zeros go to end. Result: [1,0,0].Input: [1,2,3]
Output: [1,2,3]
Explanation: No zeros present. Array unchanged.1 <= nums.length <= 10^4-2^31 <= nums[i] <= 2^31-1