Encircular

Problem Overview

  • Determine if a robot that repeats a command string (G, L, R) infinitely remains within a circle.
  • Input: array of command strings (length 1–2500, n up to 10); Output: array of "YES"/"NO" per command.
  • Context: simulate a mobile robot on an infinite plane starting at (0,0), moving forward or turning left/right.
  • A classic coding interview problem from Goldman interviews; this interview question tests understanding of robot motion behavior.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: