How would you write code to move all zeros in an array or list to the right while keeping non-zero order?
Implement move_zeros(nums) to modify the input list in place and return it; non-zero values must retain their relative order. For example, [0, 1, 0, 3, 12] becomes [1, 3, 12, 0, 0], while [1, 2, 3] remains unchanged. Assume nums contains integers, may be empty, and has length at most 10^3; target O(n) time and O(1) extra space.
def move_zeros(nums):