A grid-traversal classic that tests BFS/DFS flood fill and the visited-marking discipline. The signal is treating the grid as a graph and counting connected components. Here is the answer.
Unlock the other 754 answers · ₹2,000 / $25includes both full courses · progress stays saved · 6 months · one payment · no auto-renew
