Загрузка страницы

GOOGLE CODING INTERVIEW QUESTION - NUMBER OF ISLANDS (LeetCode)

One of Google's most commonly asked interview questions according to LeetCode.

Google Coding Interviews Number of Islands (LeetCode) and explanation.
This interview question is from LeetCode and commonly asked by the following companies: Google, Facebook, Amazon, Lyft, Uber, LinkedIn, Apple, Bloomberg, Microsoft, Alibaba, and more.

Problem description: Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water.

Example 1:
Input:
11110
11010
11000
00000
Output: 1

Example 2:
Input:
11000
11000
00100
00011
Output: 3

Support me on Patreon: https://www.patreon.com/KevinNaughtonJr
Follow me on GitHub: https://github.com/kdn251
Follow me on Instagram: https://www.instagram.com/programeme

Видео GOOGLE CODING INTERVIEW QUESTION - NUMBER OF ISLANDS (LeetCode) канала Kevin Naughton Jr.
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
9 сентября 2018 г. 23:53:46
00:10:14
Яндекс.Метрика