Analytics Vidhya
Published in

Analytics Vidhya

Number of Islands — Day 5(Python)

Photo by Alex Antoniadis on Unsplash

Today we would be looking at one of the interviewers’ favorite questions. A frequently asked question in technical coding interviews. The question tests your understanding of Breadth-First-Search and Depth-First-Search and, I will solve the problem using both methods.

200. Number of Islands

Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An…

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store