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

FACEBOOK - WALLS AND GATES (LeetCode)

This is one of Facebook's most commonly asked interview questions according to LeetCode (2019)! Walls and Gates coding solution. If you give me 5 minutes you'll thank me if this appears during your Facebook interview! Coding Interviews Walls and Gates (LeetCode) question and explanation.

DISCORD CHANNEL
----------------------------------------------------------------------------------------------------------------
To join the Discord channel use the following link and join the "Member" tier: https://www.patreon.com/KevinNaughtonJr
In this Discord channel, you will be able to...
1. Ask me questions directly (as well as other members)
2. Ask about and discuss previous interview experiences
3. Find mock interview partners
4. Share helpful videos for interview preparation, and more!

This question is commonly asked by the following companies: Facebook, Amazon, Microsoft, and Uber.

Link to problem: https://leetcode.com/problems/walls-and-gates/

Intuition behind solution: Iterate through the grid running a dfs on every single gate we encounter. During our dfs we stop if we have, gone out of the bounds of the grid, or if the cell we are currently on has a smaller distance than our current distance (this means there is another gate that is closer to it than the gate we are currently running a dfs on). Once we have finished iterating through the board we will have updated all reachable cells with their respective shortest distances to a gate.

SOCIAL
----------------------------------------------------------------------------------------------------------------
Support me on Patreon: https://www.patreon.com/KevinNaughtonJr
Follow me on Twitter: https://twitter.com/KevinNaughtonJr
Follow me on Instagram: https://instagram.com/kevinnaughtonjr/
Follow me on GitHub: https://github.com/kdn251

MUSIC
----------------------------------------------------------------------------------------------------------------
Muddy With My Buddy (Prod. Loud Lord) by 3T Brax
https://soundcloud.com/3tbrax/muddy-with-my-buddy

#coding #interviews #softwareengineering

Видео FACEBOOK - WALLS AND GATES (LeetCode) канала Kevin Naughton Jr.
Показать
Комментарии отсутствуют
Введите заголовок:

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

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

Зарегистрируйтесь или войдите с
Информация о видео
23 апреля 2019 г. 7:09:34
00:08:09
Яндекс.Метрика