https://leetcode.com/problems/largest-unique-number/
Given an array of integers A
, return the largest integer that only occurs once.
If no integer occurs once, return -1.
Example 1:
Input: [5,7,3,9,4,9,8,3,1] Output: 8 Explanation: The maximum integer in the array is 9 but it is repeated. The number 8 occurs only once, so it's the answer.
Note:
-
1 <= A.length <= 2000
-
0 <= A[i] <= 1000