Push every 0 in the integer array nums to the back of the array. The other numbers must stay in the same order they had before, packed together at the front.
Change nums itself and return nothing: don't build and hand back a second array. The judge reads nums after your function finishes, and that is the output shown in each example.
The non-zero values read 4, -2, 7, 5 both before and after. The three zeros fill the last three slots.
With no zeros to move, nums is left exactly as it was.
Constraints
1 <= nums.length <= 10⁴-2³¹ <= nums[i] <= 2³¹ - 1Think of it as keeping the non-zero values rather than moving the zeros: if they are packed to the front in their original order, the zeros are whatever is left over at the back.