GOOGLE - BOATS TO SAVE PEOPLE (LeetCode)
This is one of Google's most commonly asked interview questions according to LeetCode (2019)! Boats to Save People coding solution. If you give me 5 minutes you'll thank me if this appears during your interview! Coding Interviews Boats to Save People (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
Link to problem: https://leetcode.com/problems/boats-to-save-people/
Intuition behind solution: Sort the array of people. Iterate through the people with a pointer i starting at the first person (lightest) and a pointer j starting at the last person (heaviest) Greedily try and either...
1. Pair the heaviest and lightest person together in a boat (increment i and decrement j)
2. Simply take the heaviest in a boat alone (only decrement j)
and then increment the number of boats used. Once i and j cross, return the number of boats you have used.
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
----------------------------------------------------------------------------------------------------------------
uwu popped a bean by star printer
https://soundcloud.com/star-printer/uwu-popped-a-bean
#coding #interviews #softwareengineering
Видео GOOGLE - BOATS TO SAVE PEOPLE (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
Link to problem: https://leetcode.com/problems/boats-to-save-people/
Intuition behind solution: Sort the array of people. Iterate through the people with a pointer i starting at the first person (lightest) and a pointer j starting at the last person (heaviest) Greedily try and either...
1. Pair the heaviest and lightest person together in a boat (increment i and decrement j)
2. Simply take the heaviest in a boat alone (only decrement j)
and then increment the number of boats used. Once i and j cross, return the number of boats you have used.
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
----------------------------------------------------------------------------------------------------------------
uwu popped a bean by star printer
https://soundcloud.com/star-printer/uwu-popped-a-bean
#coding #interviews #softwareengineering
Видео GOOGLE - BOATS TO SAVE PEOPLE (LeetCode) канала Kevin Naughton Jr.
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
GOOGLE CODING INTERVIEW QUESTION - BAG OF TOKENSAMAZON CODING INTERVIEW QUESTION - PARTITION LABELS (LeetCode)GOOGLE - HAPPY NUMBER (LEETCODE)LeetCode Find First and Last Position of Element in Sorted Array Solution Explained - JavaFACEBOOK - BINARY TREE RIGHT SIDE VIEW (LeetCode)GOOGLE - MAXIMUM DEPTH OF BINARY TREE (LeetCode)GOOGLE - REPEATED DNA SEQUENCES (LeetCode)SOLVING MICROSOFT'S 2020 MOST ASKED INTERVIEW QUESTIONGOOGLE - NEXT CLOSEST TIME (LeetCode)GOOGLE - COUNT PRIMES (LeetCode)arranging coins | arranging coins leetcode | leetcode 441 | binary search | mathGOOGLE CODING INTERVIEW QUESTION - SHORTEST WAY TO FORM STRINGASKING MY GIRLFRIEND QUESTIONS ABOUT SOFTWARE ENGINEERING...GOOGLE CODING INTERVIEW QUESTION - FROG JUMP (LeetCode)GOOGLE PHONE INTERVIEW QUESTION - LARGEST VALUES FROM LABELSSliding Window Technique - Algorithmic Mental ModelsHow to prepare for coding interviews using Leetcode? Why Leetcode is the bestGOOGLE CODING INTERVIEW QUESTION - FRUIT INTO BASKETS (LeetCode)