Search
⌘K

Leetcode 694. Number of Distinct Islands

Given a binary grid, count how many distinct island shapes (connected components of 1s via 4-directional adjacency) appear, treating two islands as identical if they match up to translation (but not rotation/reflection). The key challenge is to normalize each island's shape (e.g., by relative coordinates or a traversal signature) so you can deduplicate shapes efficiently.

Asked at:

Oracle


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Mid November, 2025

Oracle

Senior

Nothing specific, exactly same question.

Comments

Your account is free and you can post anonymously if you choose.