[Solution] Similar Heights Codechef Solution
Chef is teaching his class of students at Hogwarts. He groups students with the same height together for an activity. Some of the students end up in a groups with only themselves and are saddened by this.
With the help of his magic wand, Chef can increase the height of any student to any value he likes. Now Chef wonders, what is the minimum number of students whose height needs to be increased so that there are no sad students?
Input Format
- The first line of input will contain a single integer , denoting the number of test cases.
👇👇👇👇👇
- Each test case consists of two lines of input.
- The first line of each test case contains one integer — the number of students.
- The second line consists of space-separated integers denoting the heights
- of the students.
Output Format
For each test case, output on a single line the minimum number of students whose heights must to be increased.
Constraints
- The sum of over all test cases won't exceed .
No comments:
Post a Comment