← All problemsSign in

Connected Components

Chef is a teacher at a school. He wishes to give projects to his students to work on during the summer break. Chef needs to prove to the headmaster that he is a competent teacher and hence he wants maximum projects. However students who are friends wish to work together, while those who don’t will work alone. Chef has a soft corner for them, hence he allows this. Given the friendship relationsh

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