Numbers"
Next: [apartments](apartments.html)
You are given a list of n integers, and your task is to calculate the number of distinct values in the list.
Input
The first input line has an integer n: the number of values.
The second line has n integers x1,x2,...,xn.
Output
Print one integers: the number of distinct values.
You are given a list of integers, and you want to count the unique ones. Collect the items into a set, and return the length of the set.
{{# include _include/code/algorithms/cses/cpp/sorting-and-searching/distinct-numbers.cc }}
Next: [apartments](apartments.html)