Matrix
No. 200. Number of Islands: DFS
No. 305: Number of Islands II: DFS + Path Compression(roots[id] = roots[roots[id]];) solution
No. 694: Number of Distinct Islands BFS + set (translation | set of all points: (x, y) -> (x - top, y - left))sol
No. 711: Number of Distinct Islands II (Lintcode: No. 433 Number of Islands): sol2
No. 240 Search a 2D Matrix II: Divide and conquer for 4 blocks; Search row and column step by step; Saddleback Search
Last updated