Given an integer array, return the first index where the current value has already appeared earlier in the array. If no duplicate exists, return -1.
-1
1 <= len(nums) <= 10^5
-10^9 <= nums[i] <= 10^9
Your question is First Duplicate Value Index. 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.