One common friend
CodeChefOpen on judge ↗
In a primal culture, there are infinite gods, the supreme god is called $ένας$. A god can have a set of friends but every other god is a friend of $ένας$. You as a mythologist need to find all gods who has only $ένας$ as a mutual friend of $N$-th god. ###Input: - The input will contain $N$, denoting $N$th god. ###Output: - List of all gods satisfying the criterion. Note: Refer to
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.
Sign in to chat with the tutor and save your progress.
Sign in to start