Infinite wall Robot
CodeChefOpen on judge ↗
A robot stands at (0,0), with its back against an infinite wall defined by y = 0. It can receive one of three instructions: 1. “G”: go straight 1 unit 2. “L”: turn 90 degrees to the left 3. “R”: turn 90 degrees to the right The robot performs the instructions given in order, and repeats them till it encounters the wall again. Return true if and only if a final position exists. Note: 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.
Sign in to chat with the tutor and save your progress.
Sign in to start