GOOGLE CODING INTERVIEW QUESTION - HOUSE ROBBER (LeetCode)
This is one of Google's most commonly asked interview questions according to LeetCode (2019)! House Robber coding solution. If you give me 5 minutes you'll thank me if this appears during your interview! Coding Interviews House Robber (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: Google, Amazon, Quora, and Adobe.
Link to problem: https://leetcode.com/problems/house-robber/
Intuition behind solution: Solve the problem for simpler cases to help us solve the larger problem at hand (this is the idea of bottom-up processing). Create a dp array where dp[i] will represent the max amount of money we can rob up to and including the current house. First fill the simple cases, or base cases, of the dp array like dp[0] = nums[0] (the most amount of money we can rob up to the first house is however much money is in the first house, dp[1] = max of num[0] and nums[1] (we can't rob both because of the alarm systems so rob whichever house has more money). Then iterate through the rest of the dp array populating dp[i] at every iteration using the follow logic...dp[i] = max of robbing the current house and however much money we had 2 houses before, or simply continue on with the max amount of money we had robbed up to the previous house. Once you have populated the dp array simply return the last entry which represents the max amount of money you can rob from all the houses without triggering the alarm system.
SOCIAL
----------------------------------------------------------------------------------------------------------------
Support me on Patreon: https://www.patreon.com/KevinNaughtonJr
Follow me on Twitter: https://twitter.com/KevinNaughtonJr
Follow me on Instagram: https://www.instagram.com/kevinnaughtonjr/
Follow me on GitHub: https://github.com/kdn251
MUSIC
----------------------------------------------------------------------------------------------------------------
Blushes by Dj Quads
https://soundcloud.com/aka-dj-quads/blushes
#coding #interviews #softwareengineering
Видео GOOGLE CODING INTERVIEW QUESTION - HOUSE ROBBER (LeetCode) канала Kevin Naughton Jr.
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: Google, Amazon, Quora, and Adobe.
Link to problem: https://leetcode.com/problems/house-robber/
Intuition behind solution: Solve the problem for simpler cases to help us solve the larger problem at hand (this is the idea of bottom-up processing). Create a dp array where dp[i] will represent the max amount of money we can rob up to and including the current house. First fill the simple cases, or base cases, of the dp array like dp[0] = nums[0] (the most amount of money we can rob up to the first house is however much money is in the first house, dp[1] = max of num[0] and nums[1] (we can't rob both because of the alarm systems so rob whichever house has more money). Then iterate through the rest of the dp array populating dp[i] at every iteration using the follow logic...dp[i] = max of robbing the current house and however much money we had 2 houses before, or simply continue on with the max amount of money we had robbed up to the previous house. Once you have populated the dp array simply return the last entry which represents the max amount of money you can rob from all the houses without triggering the alarm system.
SOCIAL
----------------------------------------------------------------------------------------------------------------
Support me on Patreon: https://www.patreon.com/KevinNaughtonJr
Follow me on Twitter: https://twitter.com/KevinNaughtonJr
Follow me on Instagram: https://www.instagram.com/kevinnaughtonjr/
Follow me on GitHub: https://github.com/kdn251
MUSIC
----------------------------------------------------------------------------------------------------------------
Blushes by Dj Quads
https://soundcloud.com/aka-dj-quads/blushes
#coding #interviews #softwareengineering
Видео GOOGLE CODING INTERVIEW QUESTION - HOUSE ROBBER (LeetCode) канала Kevin Naughton Jr.
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
LeetCode 198. House Robber (Algorithm Explained)AMAZON CODING INTERVIEW QUESTION - COIN CHANGE (LeetCode)GOOGLE - BOATS TO SAVE PEOPLE (LeetCode)Why you're failing coding interviews...GOOGLE - MAXIMUM DEPTH OF BINARY TREE (LeetCode)SOLVING LYFT'S 2020 MOST ASKED INTERVIEW QUESTIONGOOGLE CODING INTERVIEW QUESTION - FRUIT INTO BASKETS (LeetCode)GOOGLE - COUNT PRIMES (LeetCode)AMAZON CODING INTERVIEW QUESTION - COMBINATION SUM II (LeetCode)GOOGLE CODING INTERVIEW QUESTION - CLIMBING STAIRS (LeetCode)AMAZON CODING INTERVIEW QUESTION - REORGANIZE STRINGFACEBOOK CODING INTERVIEW QUESTION - PARTITION EQUAL SUBSET SUM (LeetCode)Dynamic Programming: House Robber - Leetcode 198AMAZON - PATH SUM II (LeetCode)GOOGLE - HAPPY NUMBER (LEETCODE)FACEBOOK CODING INTERVIEW QUESTION - VALIDATE BINARY SEARCH TREEGOOGLE - SAME TREE (LeetCode)AMAZON CODING INTERVIEW QUESTION - PARTITION LABELS (LeetCode)What Is Dynamic Programming and How To Use It