← All problemsSign in

People At Party

You are at a party of $N$ people, where only one person is known to everyone. Such a person $\text{may be present}$ in the party, if yes, (s)he doesn’t know anyone at the party. Your task is to find the $stranger (guest)$ at the party. You will be given a square matrix $M$ where if an element of row $i$ and column $j$ is set to 1 it means the ith person knows the jth person. You need to fin

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