Number of Spaces Cleaning Robot Cleaned
Explore how to model a cleaning robot moving in a 2D binary matrix representing a room with obstacles. Learn to track the robot's path as it moves straight until blocked, then turns right, cleaning spaces without repetition. This lesson helps you understand matrix traversal, handling direction changes, and detecting repeated states to count unique cleaned spots.
We'll cover the following...
We'll cover the following...
Statement
You are given a 0-indexed 2D binary matrix, room, representing a room of size