Reorder nums so every zero appears after all non-zero values while preserving the relative order of non-zero values. Return the reordered array; implementations should update the supplied array when the language supports mutation.
Input / output
nums: integer[]Examples
[0,1,0,3,12] returns [1,3,12,0,0].[1,2,3] remains [1,2,3].Constraints
0 <= nums.length <= 100,000-1,000,000 <= nums[i] <= 1,000,000Follow-up Can you use two pointers with linear time, constant auxiliary space, and the minimum necessary writes?