Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 302. Smallest Rectangle Enclosing Black Pixels
Given a binary image and the coordinates of one black pixel, compute the area of the smallest axis-aligned rectangle that contains all black ('1') pixels. The challenge is to determine the top/bottom/left/right boundaries efficiently (e.g., via binary search on rows/columns or DFS/BFS of the connected black region) rather than scanning the entire matrix.
Asked at:
Meta
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Early October, 2025
Meta
Mid-level
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.