Implement a function to remove duplicates from an array while preserving the original order.
Given an array of integers, return a new array containing only the first occurrence of each value, in the order those values first appear. The input must not be modified; for example, [4, 2, 4, 1, 2] returns [4, 2, 1], and [] returns []. The array contains at most 1,000 integers, and values may be positive, negative, or zero.
def remove_duplicates(nums):