← All problemsSign in

Similar Heights

CodeChefRating 1390Open on judge ↗

Chef is teaching his class of $N$ 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 incr

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start