Search⌘ K
AI Features

Number of Spaces Cleaning Robot Cleaned

Explore how to calculate the number of unique spaces a cleaning robot visits in a binary matrix room. Understand robot movement rules, matrix traversal, and edge conditions to implement an efficient solution that tracks visited spaces and direction-based repeats.

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 ...