Number of Islands
Graphs · DFS · BFS · Matrix · greeting
Learn modeInterviewLearnLarry’s gold answer — use Show text to read it out loud
00:00End interview
Number of Islandsm × n binary grid▶1▶1▶0▶0▶1▶0▶0▶0▶1▶1 = land0 = water4-neighbors▶
Owl: Hi. Number of Islands. Before we write any code, tell me how you would approach this. What does an island mean to you in terms of graph traversal?
You: —