Back to Question
Number of Islands
Question Explain
Given an $m \times n$ 2D binary grid, return the number of islands. An island is formed by connecting adjacent '1's. Use DFS or BFS.
Start Trying This Question Simulation
Click "Start Speaking" and answer the question naturally.