GOOGLE CODING INTERVIEW QUESTION - BAG OF TOKENS
SOCIAL
----------------------------------------------------------------------------------------------------------------
Instagram: https://instagram.com/kevinnaughtonjr/
Twitter: https://twitter.com/KevinNaughtonJr
Patreon: https://www.patreon.com/KevinNaughtonJr
GitHub: https://github.com/kdn251
This is one of Google's most commonly asked interview questions according to LeetCode (2020)! Google coding interview question, bag of tokens, coding solution. If you give me 5 minutes you'll thank me if this appears during your Google interview! Coding Interviews bag of tokens (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/bag-of-tokens/
Intuition behind solution: Greedily get coins whenever possible. Sort the array to always know the smallest token and largest tokens by using two pointers. Iterate through the array of tokens while your two pointers haven't crossed. At every iteration, get a point if possible (if you have enough power for the smallest token). If you can't get a point, but you have a point to give, give in that point for the most amount of power available (largest token). If you cannot get a point and don't have any points, return the max number of points you've received throughout the game.
MUSIC
----------------------------------------------------------------------------------------------------------------
Off the balm+ by Lo-Kage
https://soundcloud.com/halflithalfwit/balm
#techinterviews #leetcode #googleinterview
Видео GOOGLE CODING INTERVIEW QUESTION - BAG OF TOKENS канала 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 one of Google's most commonly asked interview questions according to LeetCode (2020)! Google coding interview question, bag of tokens, coding solution. If you give me 5 minutes you'll thank me if this appears during your Google interview! Coding Interviews bag of tokens (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/bag-of-tokens/
Intuition behind solution: Greedily get coins whenever possible. Sort the array to always know the smallest token and largest tokens by using two pointers. Iterate through the array of tokens while your two pointers haven't crossed. At every iteration, get a point if possible (if you have enough power for the smallest token). If you can't get a point, but you have a point to give, give in that point for the most amount of power available (largest token). If you cannot get a point and don't have any points, return the max number of points you've received throughout the game.
MUSIC
----------------------------------------------------------------------------------------------------------------
Off the balm+ by Lo-Kage
https://soundcloud.com/halflithalfwit/balm
#techinterviews #leetcode #googleinterview
Видео GOOGLE CODING INTERVIEW QUESTION - BAG OF TOKENS канала Kevin Naughton Jr.
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
![GOOGLE PHONE INTERVIEW QUESTION - LARGEST VALUES FROM LABELS](https://i.ytimg.com/vi/84xibeO_lqk/default.jpg)
![FACEBOOK - KTH SMALLEST ELEMENT IN A BST (LeetCode)](https://i.ytimg.com/vi/C6r1fDKAW_o/default.jpg)
![AMAZON - MINIMUM COST TO CONNECT STICKS (LeetCode)](https://i.ytimg.com/vi/3dqR2nYElyw/default.jpg)
![GOOGLE CODING INTERVIEW QUESTION - BINARY TREE LONGEST CONSECUTIVE SEQUENCE](https://i.ytimg.com/vi/oSYGjIq6ZM4/default.jpg)
![HOW TO USE LEETCODE EFFECTIVELY...](https://i.ytimg.com/vi/iGFnsuMeUQY/default.jpg)
![GOOGLE - REPEATED DNA SEQUENCES (LeetCode)](https://i.ytimg.com/vi/0y7pU6PPrc4/default.jpg)
![](https://i.ytimg.com/vi/8A6ZZMduNaE/default.jpg)
![GOOGLE - BATTLESHIPS IN A BOARD (LeetCode)](https://i.ytimg.com/vi/wBG6078g1gE/default.jpg)
![GOOGLE - DELETE NODES AND RETURN FOREST (LeetCode)](https://i.ytimg.com/vi/aaSFzFfOQ0o/default.jpg)
![GOOGLE - VALID MOUNTAIN ARRAY (LeetCode)](https://i.ytimg.com/vi/WWysBX-N2Ak/default.jpg)
![AMAZON - MINIMUM PATH SUM (LeetCode)](https://i.ytimg.com/vi/ItjZdu6jEMs/default.jpg)
![SOLVING LYFT'S 2020 MOST ASKED INTERVIEW QUESTION](https://i.ytimg.com/vi/5AV33YdtDYw/default.jpg)
![CODING INTERVIEW QUESTION - ASSIGN COOKIES](https://i.ytimg.com/vi/1JDh9O7GDyA/default.jpg)
![GOOGLE CODING INTERVIEW QUESTION - SHORTEST WAY TO FORM STRING](https://i.ytimg.com/vi/evesA3gr9BE/default.jpg)
![FACEBOOK CODING INTERVIEW QUESTION - DECODE WAYS (LeetCode)](https://i.ytimg.com/vi/cQX3yHS0cLo/default.jpg)
![GOOGLE CODING INTERVIEW QUESTION - HOUSE ROBBER (LeetCode)](https://i.ytimg.com/vi/xlvhyfcoQa4/default.jpg)
![FACEBOOK CODING INTERVIEW QUESTION - ADD STRINGS](https://i.ytimg.com/vi/_Qp-CTzat50/default.jpg)
![FACEBOOK CODING INTERVIEW QUESTION - PARTITION EQUAL SUBSET SUM (LeetCode)](https://i.ytimg.com/vi/3N47yKRDed0/default.jpg)
![Ep.1: Depth-First Search - LeetCode Problems That Got Me Hired](https://i.ytimg.com/vi/nNGSZdx6F3M/default.jpg)
![FACEBOOK CODING INTERVIEW QUESTION - VALIDATE BINARY SEARCH TREE](https://i.ytimg.com/vi/Z_-h_mpDmeg/default.jpg)