← All problemsSign in

Chef and Friends

Chef doesn't like the fact that he doesn't have friends on the new planet. He now is in search of new friends. Finally, he came across a bunch of people playing on the ground. Now, Chef has to decide on who he wants to be friends with. For that purpose, he designed an algorithm. He knows that every person on the new planet (except chef) has a number associated with him. This number is visible to

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