#C8306. Maximizing Array Beauty
Maximizing Array Beauty
Maximizing Array Beauty
You are given an array of integers. The beauty of the array is defined as the number of distinct elements in it.
Your task is to compute the maximum possible beauty of the array. In other words, after rearranging the elements, find the number of unique integers in the array. Mathematically, if the array is \( A = [a_1, a_2, \ldots, a_n] \), then the beauty is given by the formula:
\( \text{Beauty}(A) = |\{a_1, a_2, \ldots, a_n\}| \)
Note: The arrangement of the array does not change the number of distinct elements.
inputFormat
The first line contains a single integer \( n \) representing the number of elements in the array. The second line contains \( n \) space-separated integers representing the elements of the array.
For example: 5\n1 2 3 4 5
outputFormat
Print a single integer which is the maximum possible beauty of the array (i.e. the number of distinct elements).
## sample1
4
1