#K47277. Maximum Distinct Magical Potions
Maximum Distinct Magical Potions
Maximum Distinct Magical Potions
You are given N magical potions, each associated with a magical index. Your task is to determine the number of distinct magical indices among the potions.
More formally, if you are given a list of indices \(I = [i_1, i_2, \dots, i_N]\), you need to compute the value $$\text{distinctCount}(I)=\left|\{ i : i \in I \}\right|.$$
Input is provided from standard input and the result should be printed to standard output.
inputFormat
The input is given in two lines. The first line contains a single integer N, representing the number of potions. The second line contains N space-separated integers, where each integer represents the magical index of a potion.
For example:
6 4 3 2 4 5 3
outputFormat
Output a single integer which is the number of distinct magical indices present in the given list.
For the above example, the output would be:
4## sample
6
4 3 2 4 5 3
4