#C5857. Largest Unique Number
Largest Unique Number
Largest Unique Number
You are given an array of n integers. Your task is to find the largest number which occurs exactly once in the array. If no such number exists, output \(-1\).
Input Format: The first line of input contains an integer n representing the number of elements in the array. The second line contains n space-separated integers.
Output Format: Print the largest unique number. If there is no unique number, print \(-1\).
Example:
Input: 7 5 3 9 3 5 7 1</p>Output: 9
inputFormat
The input is given in two lines. The first line contains an integer n, the number of integers. The second line contains n space-separated integers.
outputFormat
Output a single integer, the largest number that occurs exactly once in the array, or \(-1\) if there is no such number.
## sample7
5 3 9 3 5 7 1
9