Medium · Graphs
Number of Islands
A grid of "1" for land and "0" for water. Count the islands — groups of land joined up, down, left or right.
grid = [["1","1","0"],
["1","0","0"],
["0","0","1"]]
→ 2Record your take Medium · Graphs
A grid of "1" for land and "0" for water. Count the islands — groups of land joined up, down, left or right.
grid = [["1","1","0"],
["1","0","0"],
["0","0","1"]]
→ 2Record your take