The Change Making Problem - Fewest Coins To Make Change Dynamic Programming

  Рет қаралды 221,579

Back To Back SWE

Back To Back SWE

5 жыл бұрын

Code & Problem Statement @ backtobackswe.com/platform/co...
Free 5-Day Mini-Course: backtobackswe.com
Try Our Full Platform: backtobackswe.com/pricing
📹 Intuitive Video Explanations
🏃 Run Code As You Learn
💾 Save Progress
❓New Unseen Questions
🔎 Get All Solutions
Question: You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you need to make up that amount. If that amount of money cannot be made up by any combination of the coins, return -1.
Examples:
1
Input:: coins = [1, 2, 5], amount = 11
Output 3
2
Input: coins = [2], amount = 3
Output: -1
Approach 1 (Brute Force)
We can generate all sets of coin frequencies that end up summing to the total amount given the coins that we granted and then take the sequence with the least coins in it.
This is not only harder to implement, but it entails an automatic exponential amount of work to compute all the sets of coin frequencies to only take the best answer (the set with the least coins) from.
Approach 2 (Top Down Dynamic Programming)
Example:
Input:: coins = [1, 2, 5], amount = 11
Output 3
The answer to the subproblem for amount 11 is the same thing as the MINIMUM of the answers to the sub problems with each currency deduced from the original sub problem (11) PLUS ONE since we are acting as if each coin we subtract from 11 is the last coin used to make change.
Not all paths will yield an answer, some will yield an optimal answer.
Complexities (Top Down)
A is the amount to make change for.
n is the total denominations avaliable to make change with.
Time: O( A * n )
For each amount we will approximately be doing n work in trying to deduct each denomination from the current sub problem
Our recursive tree will at maximum have a depth of S (worst case if each call deducts 1 at each call).
Space: O( A )
We answer and store a total of A subproblems in our dynamic programming table to get to our globally optimum answer.
Approach 3 (Bottom Up Dynamic Programming)
Example:
Input:: coins = [1, 2, 5], amount = 11
Output 3
We can also create a dynamic programming table going from the bottom up to the amount we want an answer for.
Complexities (Bottom Up)
A is the amount to make change for.
n is the total denominations avaliable to make change with.
Time: O( A * n )
For each amount we will potentially try each of the denominations (there are n of them).
Space: O( A )
We answer and store a total of A subproblems in our dynamic programming table to get to our globally optimum answer.
++++++++++++++++++++++++++++++++++++++++++++++++++
HackerRank: / @hackerrankofficial
Tuschar Roy: / tusharroy2525
GeeksForGeeks: / @geeksforgeeksvideos
Jarvis Johnson: / vsympathyv
Success In Tech: / @successintech

Пікірлер: 940
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Table of Contents: Me Talking (Uninteresting) 0:00 - 0:19 The Problem Introduction 0:19 - 1:48 Top Down Recursion Walkthrough 1:48 - 7:43 Bottom Up Iterative Walkthrough 7:43 - 20:18 Time Complexity 20:18 - 21:42 Space Complexity 21:42 - 22:19 Wrap Up 22:19 - 22:52 The code for this problem is in the description.
@nguyentranconghuy6965
@nguyentranconghuy6965 5 жыл бұрын
tushar roy part?
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
@@nguyentranconghuy6965 yeah
@AfroMuggleKing
@AfroMuggleKing 4 жыл бұрын
Bro I don't think your approach works for input coin = [2] and amount 3 in your bottom up approach. 2 is less than 3 so dp[3-2]=dp[1] which is 0 plus 1 is 1. which is false.
@anandartwork
@anandartwork 4 жыл бұрын
Won't greedy itself give a solution for this problem? Why use DP here?
@4sky
@4sky 4 жыл бұрын
@@anandartwork I was thinking about this as well
@snowing906
@snowing906 5 жыл бұрын
The Tushar Roy clips in between 😂😂
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
yeah, I'm geekin'
@amirtv106
@amirtv106 4 жыл бұрын
@@BackToBackSWE I can't watch Tushar anymore.... You are actually enjoyable to watch
@mauricegoldberg7458
@mauricegoldberg7458 4 жыл бұрын
this guy is literally the best at explaining algorithms on all of youtube lmao. no other vids compare haha
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
great to hear.
@bryanlozano8905
@bryanlozano8905 3 жыл бұрын
truth
@qwarlockz8017
@qwarlockz8017 2 жыл бұрын
@@bryanlozano8905 I definitely love watching them. The enthusiasm is catching!
@CostaKazistov
@CostaKazistov 2 жыл бұрын
NeetCode, Abdul Bari and Tech Dose are outstanding at explaining algorithms as well
@gurtagel
@gurtagel 5 жыл бұрын
Dude this is legit the best video i have found by far on DP. Please keep making these on hard-to-grasp CS concepts (maybe do rabin-karp/other string matching algos next lol). The other youtubers dont explain at the level you do, they make too many assumptions about what is obvious, or their accent makes the video hard-to-comprehend
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
YES. YES. YES. YOU SEE THE VISION NOW?? haha. Yeah this is exactly how I felt when my head was in the dirt learning dp. I was always pissed off. Like...I need not say more. What you said is why I grind out these videos. That is the vision. A channel of hundreds of videos with CRYSTAL clear explanations. A lofty goal, but better to shoot for the moon and to land amongst the....you know the quote :) Edit: Future Ben is reading this comment haha (version 9/2/2019 me), I made this comment when I was crazy and no one watched the channel. Precontext.
@cherriercheung
@cherriercheung 5 жыл бұрын
Back To Back SWE love your videos! Keep up with your good work!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
Just reread this comment and I sound crazy lol
@wizziesfan
@wizziesfan 4 жыл бұрын
@@BackToBackSWE but we love you
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
@@wizziesfan wassup
@ABU_BEKIR_SIDDIK
@ABU_BEKIR_SIDDIK 4 жыл бұрын
12:24 "1+1 =2" I felt that.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
what lol
@leonardomaffeidasilva9774
@leonardomaffeidasilva9774 4 жыл бұрын
Wow: U did the calculations till the end, instead of saying "and so on". +1 Good explanation. ;)
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thx
@RicardoBuquet
@RicardoBuquet 4 жыл бұрын
If he wouldn't have done that, I think I wouldn't have understood it :D
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
@@RicardoBuquet nice
@ameyparanjape3292
@ameyparanjape3292 3 жыл бұрын
That does make it clearer, Kudos!
@woodslee6202
@woodslee6202 3 жыл бұрын
+1. this is remind me of studying mathematical proof, it skip some steps by saying like "it's obvious", but I did not get it.
@rakeshnarvaneni9300
@rakeshnarvaneni9300 4 жыл бұрын
Dude, this is the best explanation for Dynamic Programming on KZfaq. Please keep going!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
nice, thx
@stressfreetrading1341
@stressfreetrading1341 4 жыл бұрын
"We have tried all our coins and the winner is 5" "I have tried all other videos and the winner is U"... best explanation bro.. thanks alottttt....
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thx
@jim7195
@jim7195 5 жыл бұрын
perfect explanation dude, the Tushar part was gold lmao
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
I know, I was getting silly :)
@betim2007
@betim2007 4 жыл бұрын
I have watched a lot of videos on youtube trying to find a good explanation for this, but none comes close to this video. For someone just learning to program, I will say this guy is an excellent teacher.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks for the kind comment.
@Abhay.Bhandari
@Abhay.Bhandari 3 жыл бұрын
I have no words to thank you. You are really awesome!! This question I am trying to understand from 3 days. But you had cleared in just 20 mins. Teaching is an art and you are a great artist.
@CSam-hc4uk
@CSam-hc4uk 5 жыл бұрын
Thanks for being so patient explaining how the values are put in every cell!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
sure
@oolong4700
@oolong4700 4 жыл бұрын
This is the most clear explanation that i have ever heard! thanks a lot.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure
@elvinjafarli6257
@elvinjafarli6257 3 жыл бұрын
Hey there man, I want to thank you for the effort and time you spent making this pure information brilliance available for free. Best of luck and wishes in your future endeavors. You are helping us out a lot :)
@pritabratamallik5391
@pritabratamallik5391 3 жыл бұрын
I really appreciate his style of explanation. He repeats himself, a lot. Probably it is because of this we are able to grasp the concepts. He is really filling the gaps left out by other creators.
@nnamdiibeanusi5309
@nnamdiibeanusi5309 4 жыл бұрын
This is THE BEST explanation for dynamic programming I have ever seen. I appreciate how you focused on the intuition behind the technique and solved the problem to its completion rather than just saying "And so on..."
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks
@Izma9
@Izma9 5 жыл бұрын
God bless you mate. I was trying to understand the solution from the leetcode explanation for hours and from the guy in your video at the beginning as well. You have a talent to teach complex things in understandable way. Keep up the good work
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
haha thx...mate
@curt1893
@curt1893 3 жыл бұрын
Man, I love your energy and you are making this make so much sense! I hope you are doing well.
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
yes and thx
@lavishgarg4274
@lavishgarg4274 4 жыл бұрын
you are great bro, the thing which I am not getting from past 5 days has been deliberately and easily explained by you in just 23 minutes,god is seeing all your good work, be happy and be successful in your career.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
nice
@chandrashekhar9470
@chandrashekhar9470 4 жыл бұрын
You make code visualizes into our head like a movie.Its like we are watching some coding based movie which is so exciting and interesting that we just go into recursion and get the best.Thanks a lot for such a deep explanation.Keep posting more videos these are quite useful.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
ha nice
@thekewlwaffle
@thekewlwaffle 5 жыл бұрын
And it finally clicked in my brain, THANK YOU! Subscribed!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
THAT IS AWESOME. This is why I do this. I hope you have more moments like that.
@arsyaswanth5
@arsyaswanth5 5 жыл бұрын
Tushar Roy wants to know your location!!!🤣🤣
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
hahahahahahahahahahah, best comment ever!
@Goateduzi
@Goateduzi 3 жыл бұрын
Lmao I’m geeked
@ameynaik2743
@ameynaik2743 3 жыл бұрын
Whats the story behind this? Just curious!
@Abhay.Bhandari
@Abhay.Bhandari 3 жыл бұрын
@@BackToBackSWE only an Indian can give such comments. 😆
@vincenzoincutti
@vincenzoincutti 4 жыл бұрын
Really well explained ! Thank you so much I've been trying to wrap my mind around my lecturer's explanation but your way of explaining is way clearer!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
ye
@8767346704
@8767346704 4 жыл бұрын
The way you explained was amazing, period. I tried to watch to other videos for the explanation, but the idea clicked easily with your approach! also kudos to the entire walk through till the last iteration! Thanks! keep posting such awesome stuff!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
Thanks and thanks and ok
@cluster027
@cluster027 5 жыл бұрын
Thank you for tracing the entire solution when you were doing the bottom up approach. It made it much more understandable.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
sure
@manojamrutharaj9071
@manojamrutharaj9071 4 жыл бұрын
Very well explained. Great energy and amazing presentation skills. Keep up the good work Benyam. You might have lost first 3 interviews, but, your videos might have helped others crack their interviews in some way. Be proud of it. Thanks for your effort in making these videos.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure
@kiratis
@kiratis 4 жыл бұрын
I have searched a lot of tutorials about the change making problem and I can say that your VDO explanation is the best.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
ay, cool
@pascuallopez8910
@pascuallopez8910 3 жыл бұрын
In my algorithms class , and this saved my life. Thank you for this . DP isn't as scary as it was made to seem !
@BackTrack35
@BackTrack35 5 жыл бұрын
Dude I love u xD , My exam is in 2 days and i have been trying to solve this question for hours and I almost got depressed cuz i couldn't solve it. u made it clear and simple and easy to understand , couldn't ask for a better explanation. Honestly I wish my college had lecturers like u, I swear im not kidding . thank u so much for this video , Subbed :D
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
It is nothing. Thanks for watching.
@BadBoy-hm3vk
@BadBoy-hm3vk 5 жыл бұрын
Hey!! which course are u studing now?
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
@@BadBoy-hm3vk hey
@BadBoy-hm3vk
@BadBoy-hm3vk 5 жыл бұрын
@@BackToBackSWE hey!! can you pls tell me that what i want to do after my bca.i m just confused about what to do either go for a 2 year work experience or 2 year masters and i also have a dream to be good in algorithms and machine learning.does doing mca is enough or i need to do go for higher studies?.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
@@BadBoy-hm3vk Honestly not sure. I'm a 2nd year in college as of the writing of this comment. Ask r/cscareerquestions. They have good advice.
@tanmayagarwal8513
@tanmayagarwal8513 4 жыл бұрын
Amazing effort!! I wasted my whole day in understanding this. Wish I could see that at first!! Amazing explanation.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
nice
@siddhantsharma6747
@siddhantsharma6747 4 жыл бұрын
This is totally the best Dynamic Programming video I've ever seen. Dude, you rock!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
no u
@diamondmohanty2915
@diamondmohanty2915 4 жыл бұрын
Best explanation ever. I have watched many but this is great.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thx
@abebe7017
@abebe7017 4 жыл бұрын
God bless this dude! OMG!!!! I feel I am gonna kill my interview with Microsoft!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
lol, good luck!!
@tashp
@tashp 4 жыл бұрын
This video is the best tutorial I've seen online, thank you so much for your clear explanation, you're an amazing teacher!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thx
@imSovi
@imSovi Жыл бұрын
my god. thank you for actually going through the whole thing. i didn't actually grasp the bottom up approach until you hit 3 or 4. most teachers would've stopped at 2 and said "you get the pattern". great teacher.
@nelsonthekinger
@nelsonthekinger 4 жыл бұрын
I'm clapping with all my might! Great Job! Side note: I was caught on that Face swap.. funny as hell! ahahaha XD
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
haha and thanks and sorry - old video, had few watchers
@aliaksandrhn1
@aliaksandrhn1 4 жыл бұрын
Someone please buy this gentleman a beer because God knows he deserves it. Thank you!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
I am only 20...oh wait no im 21 now lol
@paulocoelho55
@paulocoelho55 5 жыл бұрын
This channel is a life savior! Many thanks and keep up with the good work :D
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
sure
@dash8x
@dash8x 4 жыл бұрын
Thank you for this explanation. I needed this for part of an actual production system.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure
@sanjaymadhavan1893
@sanjaymadhavan1893 5 жыл бұрын
You are so underrated:")
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
haha thx
@sky76570
@sky76570 5 жыл бұрын
Follow-up: Return the actual coins.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Hahaha. No no no. Follow-up: Solve Leetcode 999..."The Protein Folding Problem"
@fardeenrahman3845
@fardeenrahman3845 5 жыл бұрын
Thank you from the bottom of my heart, Your talking style and teaching are really awesome and energetic.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Thanks - means alot
@fatihdurukan4602
@fatihdurukan4602 5 жыл бұрын
I was having a hard time to understand! Now I get it. Great explanation!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
nice
@abdoulbarry6929
@abdoulbarry6929 3 жыл бұрын
How can you be this good at explaining to students when you are a student yourself? I need to know your path Sir! Can't be the regular 20 year old college student
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
cuz im a student
@jesy1732
@jesy1732 4 жыл бұрын
Im lost with +1 *( Edited: I got it!! WOW this channel is amazing : )
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
Comeback of the century
@jesy1732
@jesy1732 4 жыл бұрын
Juan2003gtr Imagine the +1 as an action The Coins[1,2,5] Say you need to give someone change for 2 cents. You have 1 coins, 2 coins and 5 coins ( you trying to find the least amounts of ways to give change) Only way you can give change for 2 cents is 1 coins and 2 coins. (Remember an action is like +1 ) 1 coin + 1 coin = 2 cents 1 coin (action) + 1 coin(action) = 2 cents Add the actions: 1 action + 1 action = 2 actions. It took 2 actions to get 2 cents for using 1 coins. 2 coin = 2 cents 2 coin(action) = 2 cents Add the actions: +1 action = 1 action ( same as 0+1 = 1) It took only 1 action to get 2 cents, the 2 coin. We know now that the 2 coin took less actions to get 2 cents. But how does the program language know that in code form? Subtract each coin from the number 2, what ever number it is, it should already know the least amount to give change for that number you subtract to. The 1 coin: 2 - 1 coin = 1 (the number ) To get change for number 1 the least, is the 1 coin. So the number 1 already has an action the 1 coin(+1). Add another 1 coin to get the number 2, which is other action (+1) (+1) + (+1) = 2 actions (Same as 1 coin + 1 coin = 2 cents) So The 1 coin took 2 (actions) to get 2 cents The 2 coin: 2 - 2 coin = 0 (the number) To get 0 it takes no action to get zero, so it’s zero. Add the 2 coin, which is 1 action (+1) 0 + 1 = 1 action ( same as 2 coin = 2 cents) So the 2 coin is 1 (action) to get 2 cents Now compare the actions for 1 coin and 2 coin. Which is less 1 or 2? 1 (the 2 coin) Hope that helps😀
@chetansahu1505
@chetansahu1505 4 жыл бұрын
You have the talent to mentor complex things so easefully that nobody does it better.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks
@SanTosh-zg2iv
@SanTosh-zg2iv 5 жыл бұрын
Thank you my dear friend for such a lucid, clear and crisp explanation of DP , The way you taught to identify the hidden sub-problem which is the crux of DP , I appreciate your hard work. My sincere thanks to you!!!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Sure
@puperhacker2150
@puperhacker2150 5 жыл бұрын
lmao at the Tushar clips!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
hehe
@suraj8087
@suraj8087 5 жыл бұрын
what c++ is to c , is what this channel is to Tushar Roy :). P.S : Tushar Roy is a great channel
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
fascinating observation
@Megabushbuck
@Megabushbuck 3 жыл бұрын
I was struggling with this until you showed me "The CHANGE Making Problem". U are a life changer. Thanks
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
sure
@jaewoongshin5209
@jaewoongshin5209 5 жыл бұрын
Bro, this is the best explanation I have even seen..thank you for walking through all steps in the bottom-top algorithm..now I do understand how this works..
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
nice. happy you are enlightened haha
@heyitsnikhil7956
@heyitsnikhil7956 4 жыл бұрын
the 16 dislikes are from tuschar roy. 😂😂
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
haha chill
@lavishgarg4274
@lavishgarg4274 4 жыл бұрын
@@BackToBackSWE now Tushar has urged his subscribers to do 5 dislikes more
@CraigMine
@CraigMine 4 жыл бұрын
Wait are you really expected to solve something like this in a interview without having heard of the solution before? i can't imagine a lot of people would come with an algorithm like that in their mind
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
It is a famous problem
@CraigMine
@CraigMine 4 жыл бұрын
@@BackToBackSWE i was new to dynamic programming and slowly I understand thsoe problems 😍
@rohithbontala2916
@rohithbontala2916 5 жыл бұрын
Writing code becomes easier when I can understand the approach...really appreciate your explanation...Thanks a ton!!!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
nice sure
@623-x7b
@623-x7b 2 жыл бұрын
Subscribed. This is better than any teaching I've had from any of the video lectures at university. Love your exhaustive approach. The repetition really helps get the idea through!
@BackToBackSWE
@BackToBackSWE 2 жыл бұрын
Thank you, glad you liked it 😀 Do check out backtobackswe.com/platform/content and please recommend us to your family and friends 😀
@Hav0c1000
@Hav0c1000 4 жыл бұрын
When I did this problem, I imagined it as a bfs graph problem, where I have to traverse from the requested amount to 0. Each node has a neighbor that is itself - ci. as long as that value is >= 0. You can then solve this with simple BFS. Once you find 0, you have the shortest path. I see in LC, this is faster than DP. I don't understand why no one considers this method. The visited set prevents you from doing redundant work. I think BFS is the way to go... forget DP people!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks for sharing - im replying to comments super fast so can't proof-read the approach presented
@mehdisaffar
@mehdisaffar 4 жыл бұрын
I think the problem is that the memory grows too fast at every level
@tejassameera8962
@tejassameera8962 4 жыл бұрын
why does he talk like he's teaching 5 year olds lmao good content tho
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
I'm in a library so had to talk quietly. This was early when I didn't have a microphone and like 2 people watched lol
@tejassameera8962
@tejassameera8962 4 жыл бұрын
Back To Back SWE 😂😂 all love dude. Ur content is actually fire
@tusharpanpaliya6610
@tusharpanpaliya6610 3 жыл бұрын
Best explanation from any Dynamic Problem videos i have seen till now. You makes the hard question sounds easy and understandable very clearly. Thanks for your videos. Keep up the good work my friend !!
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
thanks and ok
@warisulimam3440
@warisulimam3440 3 ай бұрын
Wonderful video and very verbose explanations. I can't believe you actually worked through each of the cases for the bottom-up approach. Most people would've done the first few and said "and so on" and filled up the remainder of the table. Thank you for the video.
@doruwyl
@doruwyl 5 жыл бұрын
Great explanation! Making this in-depth videos will help people understand easier the concepts in no time.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Thanks! This is one of the problem I cover on the site I'm making: twitter.com/thebigoguide
@chaitrajambigi3426
@chaitrajambigi3426 5 жыл бұрын
Thanks a lot for this lucid explanation, i was struggling to understand this since along time and now its much more clear
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
sure
@VioletteToussaint
@VioletteToussaint 2 жыл бұрын
Thank you so much, you're the best, you made it so easy to understand while many others use unnecessarily confusing denominations. Now everything makes sense!
@chetansahu1505
@chetansahu1505 4 жыл бұрын
Dude you are the best. The energy, enthusiasm you got is amazing. Even you become richi-rich someday don't change the way you guide in the video bro. Awesome video so far. You are the gem of all mentors. I understand it so well that I won't forget it until my last breath. Great input from your videos. Thanks for making me understand it so well.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
hahahaha nice, good to hear
@FoodieNishi
@FoodieNishi 5 жыл бұрын
Thank you so much! You've helped me understand so many of these problems
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
nice
@urussahelaheebocus8158
@urussahelaheebocus8158 Жыл бұрын
Keep up the good work.. No words to this awesome work!! We need more teachers like u 🙏
@studyaccount794
@studyaccount794 2 жыл бұрын
I was having a mid life crisis while trying to solve this problem. I have my amazon test soon. Thanks man can't thank you enough.
@VermaAman
@VermaAman 5 жыл бұрын
My whole concept of DP just became clear. Thanks a lot :)
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
nice
@GabrielToriz
@GabrielToriz 3 жыл бұрын
This is the most clear explanation for this problem! Now it's clear for me why all those operations and how they work together.
@chiranjeevipippalla
@chiranjeevipippalla 3 жыл бұрын
The Real “Ben” 10 who is helping the students prepare for their interviews. Thanks brother 🙏🏻
@oqant0424
@oqant0424 2 жыл бұрын
Dude this is legit the best video i have found by far on DP.
@MrJAEChannel
@MrJAEChannel 4 жыл бұрын
This is great, best on KZfaq for Dynamic programming. thanks!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thx
@Goateduzi
@Goateduzi 3 жыл бұрын
Good job, man. I had a friend struggling with this and I couldn’t explain worth shit. I looked for vids and yours was the best I found.
@heathivie986
@heathivie986 3 жыл бұрын
After watching video after video, I was able to solve this problem without looking at the code based only on your description. Well done, thank you
@rinado4374
@rinado4374 3 жыл бұрын
The visual helps so much in understanding the problem. Thank you so much!!
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
sure
@ritumanjunathan5590
@ritumanjunathan5590 4 жыл бұрын
This is an awesome explanation! Thank you so much for posting these videos!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure
@aswink1505
@aswink1505 4 жыл бұрын
best explanation I found for this problem. Great job!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks
@uneq9589
@uneq9589 3 жыл бұрын
As you said in the video, understanding the tree did help. Helped me understand what I was doing wrong and got me straight to the accepted solution.
@jadia
@jadia 4 жыл бұрын
I like both Tushar Roy and your channel. Anyway, both of you guys are contributing to society. Thank you for helping us out! I'll certainly buy your course if I need it in the coming months. Thanks for all these videos. Keep making more on Graphs and Trie related questions. I fear them the most.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
ok
@shivankchaturvedi4817
@shivankchaturvedi4817 4 жыл бұрын
Seriously this man made a lot of things very easy great explanations learned a lot from you
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
great!
@user-rf4vc7mt4d
@user-rf4vc7mt4d 3 жыл бұрын
This video is so good I'm watching this with my left hand on the mouse, so I can take notes with the other!
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
lol
@ananths5905
@ananths5905 4 жыл бұрын
man I cracked interview at a unicorn 5 years back but now i have to do it again and I am so out of touch. Yours are the best bcos I found ur thought to be very very similar to my thought when I was at the peak of my interview preps thanks a tonne mate
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
lets crack it again...ye
@zhiqianzhang5772
@zhiqianzhang5772 Жыл бұрын
OMG this is the best video I've ever watched for dp!! So clear and detailed!! Thank you bro!!
@terrencechungong1954
@terrencechungong1954 7 ай бұрын
This is the clearest explanation of the concept by far. Great work!
@tonynguyen6124
@tonynguyen6124 Жыл бұрын
I was confused at first when looking at the array but going through the problem helped a lot. Thanks for the great explanation.
@allanmagalhaes8211
@allanmagalhaes8211 2 жыл бұрын
Fantastic, dude. You made me understand the code even without writing a single line. Thank you.
@ricardoorellana1168
@ricardoorellana1168 5 жыл бұрын
Thanks for this awesome explanation, the bottom up step by step explanation worth gold!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
thanks
@austincallaghan2606
@austincallaghan2606 4 жыл бұрын
How you were getting the answers in the bottom up approach didn't click until you hit 8 or 9 and I was like "OH it all makes sense." Wow, thanks for explaining that all the way through. Much appreciated.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
nice
@kamranraza11
@kamranraza11 2 жыл бұрын
I dont usually comment but gotta say THANK YOU on this one. Was struggling to comprehend the mechanics of this algo. Your illustration made it crystal clear. :)
@markostojkov7763
@markostojkov7763 4 жыл бұрын
Really good explanation.Would recommend to anyone struggling with this problem.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thx
@edonis2787
@edonis2787 Жыл бұрын
This was hands down the best explanation I’ve seen on this problem
@prabhanshuaggarwal
@prabhanshuaggarwal 4 жыл бұрын
After watching 5-6 video now I am able to understand with your video finally.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
great
@danishfayaz8077
@danishfayaz8077 2 жыл бұрын
Easily the best DP explanation on youtube. Bless you brother
@mrunaldave6781
@mrunaldave6781 3 жыл бұрын
you're awesome man. thanks a lot for explaining for each amount in the bottom up approach
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
sure!
@ronakgupta7492
@ronakgupta7492 4 жыл бұрын
Best explanation so far! Never understood this problem this clear.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
nice
@nichitasindie8823
@nichitasindie8823 3 жыл бұрын
Thank you so much man!!! I can finally understand this type of problem.
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
great!
@kafuikwame8483
@kafuikwame8483 5 жыл бұрын
Great Explanation! This is the best channel!!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Thank you. We have a long way to go. I want everyone to get offers.
@kickbuttowsk2i
@kickbuttowsk2i 3 жыл бұрын
given up after half way of the video, then read some comments and continued watching the video, finally it all made sense
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
great lol
@alicebobson2868
@alicebobson2868 4 жыл бұрын
the first drawing of the tree helped me understand it much better, thx
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
great
@babumon5351
@babumon5351 4 жыл бұрын
Your explanation is really good. I never thought that most of these dynamic problems can be also solved using BFS/DFS with a HashSet for tracking duplicate. Recursion is still a problem for me. Thanks
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure
@shivateja219
@shivateja219 4 жыл бұрын
Great effort! Tracing it completely was very helpful. Thanks!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
great and sure
The 0/1 Knapsack Problem (Demystifying Dynamic Programming)
20:30
Back To Back SWE
Рет қаралды 203 М.
Looks realistic #tiktok
00:22
Анастасия Тарасова
Рет қаралды 106 МЛН
Who has won ?? 😀 #shortvideo #lizzyisaeva
00:24
Lizzy Isaeva
Рет қаралды 66 МЛН
УГАДАЙ ГДЕ ПРАВИЛЬНЫЙ ЦВЕТ?😱
00:14
МЯТНАЯ ФАНТА
Рет қаралды 4,2 МЛН
НЫСАНА КОНЦЕРТ 2024
2:26:34
Нысана театры
Рет қаралды 833 М.
Google Coding Interview With A Competitive Programmer
54:17
Clément Mihailescu
Рет қаралды 2,5 МЛН
Change Making Problem - Dynamic Programming
13:24
CSBreakdown
Рет қаралды 65 М.
Mastering Dynamic Programming - How to solve any interview problem (Part 1)
19:41
Coin Change
10:16
Kevin Naughton Jr.
Рет қаралды 153 М.
The Backtracking Blueprint: The Legendary 3 Keys To Backtracking Algorithms
13:44
1$ vs 500$ ВИРТУАЛЬНАЯ РЕАЛЬНОСТЬ !
23:20
GoldenBurst
Рет қаралды 1,9 МЛН
Xiaomi SU-7 Max 2024 - Самый быстрый мобильник
32:11
Клубный сервис
Рет қаралды 503 М.
Сколько реально стоит ПК Величайшего?
0:37
Как распознать поддельный iPhone
0:44
PEREKUPILO
Рет қаралды 2,2 МЛН
Look, this is the 97th generation of the phone?
0:13
Edcers
Рет қаралды 6 МЛН
$1 vs $100,000 Slow Motion Camera!
0:44
Hafu Go
Рет қаралды 28 МЛН