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 rotation, reflection, or translation.

Examples
Input: [[1,1,0,0,0],[1,1,0,0,0],[0,0,0,1,1],[0,0,0,1,1]]
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 rotation, reflection, or translation.