694. Number of Distinct Islands

Given a 2D grid of 1s (land) and 0s (water), count the number of distinct islands. Two islands are considered the same if they have the same shape after translation. Rotation and reflection are not allowed: an island and its rotated or mirrored copy count as different shapes. Connectivity is four-directional.

Examples
Input: [[1,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0]]
Output: 1
Hints
Related Problems

694. Number of Distinct Islands

Given a 2D grid of 1s (land) and 0s (water), count the number of distinct islands. Two islands are considered the same if they have the same shape after translation. Rotation and reflection are not allowed: an island and its rotated or mirrored copy count as different shapes. Connectivity is four-directional.