Search⌘ K
AI Features

Solution: Number of Black Blocks

C# solution for the Number of Black Blocks problem using the Hash Maps pattern.

Statement

You are given an m by n grid of cells, where some cells are colored black. The black cells are specified by coordinates, where each coordinates[i] = [r, c] marks the cell at row r and column c as black.

Consider every 2×22 \times 2 subgrid (block) fully contained in the grid. For each kk from ...