How Many Distinct Categories?
Riverbend Supply's returns desk stamps every returned item with a reason code. The monthly summary opens with a single figure: how many different reasons came up at all this month. How often each one was used does not matter to that line — a reason given ninety times and a reason given once each count for one. The codes arrive in the order the returns were processed, with repeats scattered through the file.
Task: Print how many different reason codes appear.
Input
The first line holds a single integer n, the number of returns. Each of the next n lines holds one reason code: a whole number. Codes may repeat, and repeats are not necessarily next to each other.
Output
One line holding the number of different codes, as a whole number.
Example:
Input:
5
1
2
1
3
2
Output:
3
Sign in to solve this problem
Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.
Sign in