I got the base cases fast enough: if after one cycle the robot is back at origin, it loops forever, bounded.
Simulate the robot's movement for a bounded number of steps, tracking its position and direction, and detect if it returns to a previously seen state (position and direction) or if its position exceeds a safe bound. If a cycle is detected, the robot is bounded; otherwise, it will drift away. Justify using the pigeonhole principle and discuss edge cases like empty sequence or sequences that only rotate.
Pro tip: Emphasize that the state space is finite (position modulo something and direction), so cycle detection is both necessary and sufficient; mention that you can optimize by simulating at most 4 * (max displacement per cycle) steps, but a simple visited set works for clarity.
Clarify that the robot's state is defined by its position (x, y) and direction (N, E, S, W). The sequence repeats, so the robot's behavior is periodic if it ever revisits a state.
Decide to simulate the robot's moves step by step, recording each state in a set. If a state repeats, the robot is in a cycle and thus bounded; if the position exceeds a large bound (e.g., 4 times the length of the sequence), it's unbounded.
Iterate through the sequence, updating position and direction. After each move, check if the new state is already in the set. If yes, return true; if the number of steps exceeds a safe limit, return false.
Explain that the state space is finite (position bounded by displacement per cycle, direction 4 ways), so if the robot doesn't repeat a state within a certain number of steps, it must be moving away. Time complexity is O(n) where n is the sequence length times a constant factor.
Cover cases like empty sequence, sequences that only rotate (robot stays at origin), sequences that move in a straight line (unbounded), and sequences that form a loop. Mention that using a set of states is simple but uses O(n) space; alternatively, one can simulate 4 cycles and check if displacement is zero.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.