Available question text
Given unique building coordinates on an n×n grid, count how many buildings have at least one other building strictly above, below, left, and right (i.e., same column with both smaller and larger x and same row with both smaller and larger y). The typical approach groups coordinates by row and column to efficiently check those four directional existences for up to 1e5 buildings.
Related questions
Continue with questions that share topics or the same question type.
- 1. Count number of islands in matrix (Leetcode challenge)
Coding
- Average Height of Buildings in Each Segment
Coding
- Buildings With an Ocean View
Coding · Array · Monotonic Stack · Stack
- Check if All the Integers in a Range Are Covered
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 3531. Count Covered Buildings
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source