Find the Number of Islands

Prereq: BFS on Graph

Given a 2-dimensional matrix of values with 0 and 1, count the number of islands of 1. An island consists of all value 1 cells and is surrounded by either an edge or all 0 cells. A cell can only be adjacent to each other horizontally or vertically, not diagonally.

↑TA πŸ‘¨β€πŸ«