#K83307. Minimum Number of Invitations
Minimum Number of Invitations
Minimum Number of Invitations
In a company with n employees, each employee belongs to a department represented by an integer leader. The task is to determine the minimum number of invitations required such that every department is represented by at least one invitee. In other words, if we let \(L\) be the list of department leaders, the answer is given by the number of unique values in \(L\), i.e., \(|\{L\}|\).
inputFormat
The input is given via standard input (stdin). The first line contains an integer (n) representing the number of employees. The second line contains (n) space-separated integers, where each integer represents the department leader of an employee.
outputFormat
Output a single integer to standard output (stdout) representing the minimum number of invitations required such that every department is represented.## sample
5
2 2 3 4 5
4