Available question text
Given an m x n grid with guards and walls, determine how many empty cells are not seen by any guard, where each guard observes cells in the four cardinal directions until blocked by a wall or another guard. Because m*n can be up to 1e5, the typical solution scans rows and columns (or uses linear passes) to mark visible cells efficiently.
Related questions
Continue with questions that share topics or the same question type.
- Count Cells in Overlapping Horizontal and Vertical Substrings
Coding
- Count Total Number of Colored Cells
Coding
- Find and Count Maximum-Score Grid Paths
Coding · Dynamic Programming · Grids & Matrices
- Minimum Number of Visited Cells in a Grid
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 2257. Count Unguarded Cells in the Grid
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source