Algorithm · Snapchat · Medium
Note: This problem is a variation of LeetCode 200. Number of Islands. If you haven't solved that one yet, it's recommended to complete it first. You are given an $$m \times n$$ binary grid where each cell is either '0' (water) or '1' (land). An island is a group of connected land cells, with connections allowed only horizontally or vertically (no diagonals). For each island in the grid, compute two values: Area: the total number of land cells that belong to the island. Water…
Checking your access…