How would you return a duplicated array?
Implement def duplicate_array(nums): to return a new array containing two consecutive copies of every integer in nums, preserving order and leaving the input unchanged. For example, [1, 2, 3] becomes [1, 1, 2, 2, 3, 3], while an empty input returns an empty array. The input length is at most 1,000, and values may be any integers.
def duplicate_array(nums):