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

AMAZON CODING INTERVIEW QUESTION - WORD SEARCH (LeetCode)

This is one of Amazon's most commonly asked interview questions according to LeetCode (2019)! Word Search coding solution. If you give me 8 minutes you'll thank me if this appears during your Amazon interview! Coding Interviews Word Search (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: Amazon, Google, Facebook, Microsoft, Snapchat, Uber, Bloomberg, Apple, Zillow, Oracle, Quantcast, and Cruise Automation.

Link to problem: https://leetcode.com/problems/word-search/

Intuition behind solution: Iterate through the grid looking for the first character in the desired word. If you find it, call a dfs function to continue looking for the remainder of the letters. In your dfs function check...
1. if your count of character equals the number of letters in the word you're searching for...if it does, return true as you've found the entire word.
2. check if your recursive calls has gone out of the bounds of the grid or the character you're currently looking for isn't in the cell you're on then return false.
If neither of your checks in 1 or 2 trip, set the current cell to an empty space (to not be able to use this cell again), but store it before doing so. Then make your recursive calls to neighboring cells, looking for subsequent characters. Once you recursive calls return, restore the previous cell to it's original value and return the result of your recursive calls. If you iterate through the entire board never returning true, return false.

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
----------------------------------------------------------------------------------------------------------------
Playboi Carti Magnolia Lofi Remix Prod.MAJORA by MAJORA✰
https://soundcloud.com/uwumajora/playboi-carti-magnolia-lofi-remix-prodcloud

#coding #interviews #softwareengineering

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

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

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

Зарегистрируйтесь или войдите с
Информация о видео
11 мая 2019 г. 6:16:07
00:08:46
Яндекс.Метрика