Given an unsorted array of integers nums, return a new array containing only the first occurrence of each value in the order they appear. Do not modify the input array in place unless needed for your approach.
Constraints
0 <= len(nums) <= 10^5
-10^9 <= nums[i] <= 10^9
The output must preserve the relative order of first occurrences
Interviewer
Your question is Remove Duplicates from Unsorted Array. Start with the requirements in the Question tab.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.