← All problemsSign in

Mutual Friends

You are given a task to make a simple version of mutual friends finder. There are $N$ people on a social media network. You are provided with a $\textbf{2D matrix}$ whose entry in the $\textbf{i}^{th}$ row and $\textbf{j}^{th}$ column represents whether person $\textbf{i}$ and person $\textbf{j}$ are friends (value = 1) or not friends (value = 0). Note that every person is a friend of himself

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