Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2768. Number of Black Blocks
Given an m x n grid with a list of black cell coordinates, compute how many 2x2 sub-blocks contain exactly 0..4 black cells; the challenge is to handle large grids efficiently by only examining the (up to) four 2x2 blocks affected by each black cell using a hashmap to count black cells per block and deriving zero-black blocks by subtracting from the total (m-1)*(n-1).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.