Ezvor

2061. Number of Spaces Cleaning Robot Cleaned

MediumArray Preparing judge… LeetCode
ArrayMatrixSimulation

Hints

Hint 1
Simulate how the robot moves and keep track of how many spaces it has cleaned so far.
Hint 2
When can we stop the simulation?
Hint 3
When the robot reaches a space that it has already cleaned and is facing the same direction as before, we can stop the simulation.