Search⌘ K
AI Features

Number of Spaces Cleaning Robot Cleaned

Understand how to simulate a robot cleaning path in a 2D binary matrix where empty spaces are cleaned as the robot moves. Learn to track its position and direction changes, identify repeated states, and calculate the total unique spaces cleaned by applying matrix traversal and direction logic. This lesson helps you develop problem-solving skills related to matrix manipulation and state tracking.

Statement

You are given a 0-indexed 2D binary matrix, room, representing a room of size ...