← All problemsSign in

S3 Lost

Little Anuj is lost!!! Help him find his way back to home. Anuj is sure that his home is either to the left or to the right from where he's standing. He has two sets of moves A,B, where A,B is a finite subset of the positive integers. He is confused to such an extent that he moves left and right alternatively. On every odd-numbered step, he moves 'A' moves to the right. While on every even-numbere

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