Search⌘ K
AI Features

Number of Spaces Cleaning Robot Cleaned

Explore how to determine the total unique spaces cleaned by a robot moving in a 2D binary room matrix. Understand the robot's movement pattern, obstacle detection, and how to track cleaned spaces to solve traversal problems involving direction changes and repeated visits.

Statement

You are given a 0-indexed 2D binary matrix, room, representing a room of size m×nm \times n. In this matrix, 00 represents an empty space, while ...