← All problemsSign in

Raja and Peer Pressure

Raja is very pro. His peers are tired of him answering every one of their questions and together pose a seemingly difficult problem to him. They gave Raja a map which has N (numbered 1 to N) cities. N-1 bidirectional roads connect the cities. Each city is connected by atleast 1 road. They then ask Raja Q questions. In each question, he is given 2 cities and he has to tell them the parity of the l

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