← All problemsSign in

Common Path

There are so many Houses in Sardapally. Every house has one unique number. But the only path to/from these houses is as described below 1)you can go directly only to house number 1 but not to others. 2)for other houses you have to go through other houses. a) If house number m is even u have to go through the house number m/2. b) If house number m is odd u have to go through the house number (m-1)

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