← All problemsSign in

Friendship

In society, friendship refers to the group of people with an interest towards the same topic. People connect with each other through friendship. A friendship between Person X and Person Y is represented as F XY. When two persons belonging to different friendship groups connect, the net effect is merger of both friendship groups which X and Y belonged to. We are only interested in finding out t

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