← All problemsSign in

Thirsty Mo

Mo is very thirsty and would like to find a source of water as fast as possible. There are N locations in the college where Mo can travel to. It is known that water is available only in Nandini's, Amul, Ocean Pearl, Fresh & Honest and NC. Help Mo find water given that he is currently at location X. Note: The 5 locations where water is available are indexed from 0 to 4 respectively. Input Th

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