Search⌘ K
AI Features

Number of Distinct Islands

Number of Distinct Islands gives a binary grid of land and water. Return how many connected island shapes are unique, treating islands as identical only when they match without rotation or flipping.

Statement

Given an m x n binary matrix where ...