
In a Meta mobile client, you may need to compact an integer buffer before rendering a Facebook feed module. Given an integer array nums, move all 0 values to the end of the array in place while keeping the relative order of all non-zero values unchanged.
Return the modified array.
nums, a list of integersExample 1
nums = [0, 1, 0, 3, 12][1, 3, 12, 0, 0]1, 3, 12 stay in the same order, and both zeroes are shifted to the end.Example 2
nums = [0, 0, 1][1, 0, 0]1 <= len(nums) <= 10^5-2^31 <= nums[i] <= 2^31 - 1