Search⌘ K
AI Features

Solution: Number of Distinct Islands

Explore how to identify and count distinct islands in a 2D grid by applying depth-first search to normalize island shapes. This lesson covers efficient map traversal and use of hash maps to track unique island configurations based on relative positions.

Statement

Given an m x n binary matrix where 11 represents land and 00 represents water. An island is a group of connected 1s1s ...