1133. Largest Unique Number

Given an integer array nums, return the largest element that appears exactly once in the array. If no element appears exactly once, return -1.

An element that appears only once means it has no duplicates in the array.

Examples
Input: [5,7,3,9,4,9,8,3,1]
Output: 8
Hints
Related Problems

1133. Largest Unique Number

Given an integer array `nums`, return the largest element that appears exactly once in the array. If no element appears exactly once, return `-1`.