#C10942. Unique Score Calculation
Unique Score Calculation
Unique Score Calculation
You are given N integers written on pieces of paper. Some integers may appear more than once. Your task is to calculate the total score by summing only the unique integers.
In mathematical terms, let the set of unique numbers be \( U \). The total score \( S \) is given by:
\( S = \sum_{x \in U} x \)
Note: The input numbers can be in any order and may contain duplicates. Make sure the algorithm only considers each distinct number once.
inputFormat
The first line of input contains an integer N, the number of elements. The second line contains N space-separated integers.
outputFormat
Output a single integer representing the sum of the unique numbers.
## sample5
1 2 2 3 4
10