9. First Unique Value
Easy
Return the first value in the array that appears exactly once. If there is no unique value, return null.
Example 1
Input: nums = [6,3,6,8,3,9]
Output: 8
Example 2
Input: nums = [4,4,5,5]
Output: null
Constraints
- 0 <= nums.length <= 10000
ArraysHash map
Saved in this browser
Caso 1
nums =
[6,3,6,8,3,9]
Expected =
8
Caso 2
nums =
[4,4,5,5]
Expected =
null
Run checks these 2 cases. Submit runs all 6, including hidden ones.