#K53387. Minimum Groups Formation
Minimum Groups Formation
Minimum Groups Formation
You are given the skill levels of participants. Your task is to determine the minimum number of groups required to accommodate all participants, given that each group can only consist of participants with the same skill level.
In other words, you need to count the number of distinct skill levels. This will effectively tell you how many groups are needed, since each unique skill level represents a separate group.
For example, if the input is 6\n1 2 2 1 3 3
, the distinct skill levels are 1, 2, and 3, so the output is 3.
inputFormat
The input is provided via stdin and consists of two lines:
- The first line contains an integer n representing the number of participants.
- The second line contains n space-separated integers representing the participants' skill levels.
outputFormat
Output a single integer to stdout which is the minimum number of groups required (i.e., the number of distinct skill levels).
## sample6
1 2 2 1 3 3
3