Number Of Distinct Island
Given an m*n binary matrix mat, return the number of distinct island.Input Format
An island is considered to be the same as another if and only if one island can be translated (and not rotated or reflected) to equal the other.
First line contains two integers n and m.Output Format
Each of next n lines contain n numbers containing either 0 or 1.
print number of distinct island.Question Video
1<= n <= 1000Sample Input
1<= e <= n*(n-1)/2
3 3Sample Output
1 0 0
0 1 0
1 1 1
Asked in Companies