Back to QuestionsPractice with This Question
Number of Islands
93.3K views•Asked at Amazon•
Medium
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
Practice answering orally or with text to get instant AI feedback.