#C2346. Counting Unique Items in Inventory
Counting Unique Items in Inventory
Counting Unique Items in Inventory
You are given a list of n integers which represent the IDs of items in an inventory. Your task is to determine the number of unique item IDs in the list.
If the list is empty (i.e. n = 0), then the output should be 0.
Input Format: The input is read from standard input where the first line contains an integer n. The second line contains n space-separated integers representing the inventory items.
Output Format: Print a single integer denoting the total count of distinct item IDs.
Constraints:
- 0 ≤ n ≤ 105
- The item IDs are integers.
Example
If the input is: 7
on the first line and 1 2 2 3 3 3 4
on the second line, then the output should be: 4
, since there are 4 unique items: 1, 2, 3, and 4.
inputFormat
The first line of input contains an integer n — the number of items in the inventory list. The second line contains n space-separated integers representing the item IDs.
outputFormat
Output a single integer — the count of distinct item IDs in the input list.
## sample1
2
1
</p>