CODING INTERVIEW QUESTION - ASSIGN COOKIES
SOCIAL
----------------------------------------------------------------------------------------------------------------
Instagram: https://instagram.com/kevinnaughtonjr/
Twitter: https://twitter.com/KevinNaughtonJr
Patreon: https://www.patreon.com/KevinNaughtonJr
GitHub: https://github.com/kdn251
This is a commonly asked interview question according to LeetCode (2020)! assign cookies coding solution. If you give me 5 minutes you'll thank me if this appears during your interview! Coding Interviews assign cookies (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: ???
Link to problem: https://leetcode.com/problems/assign-cookies/
Intuition behind solution: sort both your arrays. Have one pointer to point at the largest cookie and one pointer to point at the greediest child. While both pointers are greater than or equal to 0, try to assign cookies. If you can give the ith cookie to the jth child, decrement both pointers and increment your return variable, content children. If you can't, i.e. the cookie is too small for the greedy child, try assigning that cookie to the next greedy child (which means decrement j). Once your loop breaks return your number of content children.
MUSIC
----------------------------------------------------------------------------------------------------------------
[this is america] by piep*
https://soundcloud.com/boypiep/this-is-america
#techinterviews #leetcode #codinginterview
Видео CODING INTERVIEW QUESTION - ASSIGN COOKIES канала Kevin Naughton Jr.
----------------------------------------------------------------------------------------------------------------
Instagram: https://instagram.com/kevinnaughtonjr/
Twitter: https://twitter.com/KevinNaughtonJr
Patreon: https://www.patreon.com/KevinNaughtonJr
GitHub: https://github.com/kdn251
This is a commonly asked interview question according to LeetCode (2020)! assign cookies coding solution. If you give me 5 minutes you'll thank me if this appears during your interview! Coding Interviews assign cookies (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: ???
Link to problem: https://leetcode.com/problems/assign-cookies/
Intuition behind solution: sort both your arrays. Have one pointer to point at the largest cookie and one pointer to point at the greediest child. While both pointers are greater than or equal to 0, try to assign cookies. If you can give the ith cookie to the jth child, decrement both pointers and increment your return variable, content children. If you can't, i.e. the cookie is too small for the greedy child, try assigning that cookie to the next greedy child (which means decrement j). Once your loop breaks return your number of content children.
MUSIC
----------------------------------------------------------------------------------------------------------------
[this is america] by piep*
https://soundcloud.com/boypiep/this-is-america
#techinterviews #leetcode #codinginterview
Видео CODING INTERVIEW QUESTION - ASSIGN COOKIES канала Kevin Naughton Jr.
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
![GOOGLE CODING INTERVIEW QUESTION - BAG OF TOKENS](https://i.ytimg.com/vi/1GubKefOabc/default.jpg)
![Understanding Browser Cookies](https://i.ytimg.com/vi/j0PpT96EFeg/default.jpg)
![5 common LeetCode mistakes with Coding Interview Prep - Java Brains](https://i.ytimg.com/vi/Rv2aqJVRwaM/default.jpg)
![LeetCode 455. Assign Cookies Solution Explained - Java](https://i.ytimg.com/vi/EX2jEKJnzw4/default.jpg)
![AMAZON - BINARY TREE PATHS (LeetCode)](https://i.ytimg.com/vi/xqS8dyexaNM/default.jpg)
![](https://i.ytimg.com/vi/xgeMX9LNnYM/default.jpg)
![FACEBOOK CODING INTERVIEW QUESTION - VALIDATE BINARY SEARCH TREE](https://i.ytimg.com/vi/Z_-h_mpDmeg/default.jpg)
![MICROSOFT CODING INTERVIEW QUESTION - REVERSE ONLY LETTERS](https://i.ytimg.com/vi/qVADz0khbH0/default.jpg)
![Why coding isn't enough.](https://i.ytimg.com/vi/yzhnRt6ZDKM/default.jpg)
![Amazon Interview Experience | Software Engineer](https://i.ytimg.com/vi/baT3OzbOg5s/default.jpg)
![My First 4 Years as a Software Engineer (What I Learned)](https://i.ytimg.com/vi/2tH0xh2eBX8/default.jpg)
![AMAZON - LAST STONE WEIGHT (LeetCode)](https://i.ytimg.com/vi/fBPS7PtPtaE/default.jpg)
![What no one tells you about coding interviews (why leetcode doesn't work)](https://i.ytimg.com/vi/LQFsEwcCO1E/default.jpg)
![SOLVING GOOGLE'S 2020 MOST ASKED INTERVIEW QUESTION](https://i.ytimg.com/vi/9Q73ScVu2GI/default.jpg)
![Assign Cookies | Leetcode 455 | Amazon Google Facebook interview question](https://i.ytimg.com/vi/QF1uktr6uow/default.jpg)
![how I FINALLY got rid of my impostor syndrome (and how you can too)](https://i.ytimg.com/vi/dG5K168xkLY/default.jpg)
![AMAZON - REVERSE VOWELS OF A STRING (LeetCode)](https://i.ytimg.com/vi/1NXs_idViuQ/default.jpg)
![Remove Duplicates from Sorted List - Leetcode 83 - Python](https://i.ytimg.com/vi/p10f-VpO4nE/default.jpg)
![Google Coding Interview With A Normal Software Engineer](https://i.ytimg.com/vi/rw4s4M3hFfs/default.jpg)
![HOW TO PASS BIG N SOFTWARE ENGINEERING INTERVIEWS...](https://i.ytimg.com/vi/oLUG95Ai_rw/default.jpg)