dsa2 min read
Number of Islands — DFS/BFS Flood Fill
Count connected land components in a binary grid using DFS flood fill or BFS. Classic easy problem, foundation for all island variants.
Read →
webcoderspeed.com
2 articles
Count connected land components in a binary grid using DFS flood fill or BFS. Classic easy problem, foundation for all island variants.
Implement the flood fill algorithm (like paint bucket tool): replace all cells of the same color reachable from a starting cell.