Remove duplicate from given array.
Implement remove_duplicates(nums) to return a new array containing each value only once, preserving the order of its first appearance. The input is an array of integers, and the output must be an array of integers.
Example: nums = [4, 2, 4, 1, 2] returns [4, 2, 1]. The array may contain negative values, zero, and repeated values.
def remove_duplicates(nums):