Search⌘ K
AI Features

Solution: Number of Distinct Islands

Understand how to implement depth-first search and hash maps to find and count distinct islands in a binary grid. This lesson teaches normalization of island coordinates and efficient methods to compare island shapes without rotations or flips.

Statement

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