Basic count
Iterate cells. For each unvisited '1', BFS/DFS to mark whole island. Increment count.
Advertisement
Max area
Same, but track island size. Return max.
Advertisement
Distinct shapes
Normalize each island (translate to origin) → hash → count distinct hashes.