Matrix

  • No. 200. Number of Islands: DFS

  • No. 305: Number of Islands II: DFS + Path Compression(roots[id] = roots[roots[id]];) solutionarrow-up-right

  • No. 694: Number of Distinct Islands BFS + set (translation | set of all points: (x, y) -> (x - top, y - left))solarrow-up-right

  • No. 711: Number of Distinct Islands II (Lintcode: No. 433 Number of Islands): sol2arrow-up-right

  • No. 240 Search a 2D Matrix II: Divide and conquer for 4 blocks; Search row and column step by step; Saddleback Searcharrow-up-right

Last updated