← All problemsSign in

Groups

We all use facebook and have friends on facebook. Suppose there are a total of n people numbered from 1 to n. You are given all the friendships in the form a (x,y) pair. This means that x and y are friends of each other. The friendships are not transitive in nature. You have to form groups, such that, if x and y are friends of each other, then they have to be placed in the same group. No, membe

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