Question
A robot starts at the origin (0,0) facing north on an infinite plane. Given a string of instructions where 'G' moves it one step forward, 'L' turns it 90 degrees left, and 'R' turns it 90 degrees right, the robot executes the whole instruction string repeatedly forever. Return True if and only if there exists a circle such that the robot never leaves it (its trajectory is bounded). The instruction string is non-empty.
robot_bounded(instructions: str) → bool["GGLLGG"]outtrueState your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.