Simulate a Robot Following Commands on a Grid

You are given a robot on a 2D grid with an initial position and a string of movement commands. Simulate the robot.

  • Coordinate system: bottom-left is (0, 0), right is x+1, up is y+1.
  • Input i...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: