Total Unique Ways To Make Change - Dynamic Programming ("Coin Change 2" on LeetCode)

Поділитися
Вставка
  • Опубліковано 21 гру 2024

КОМЕНТАРІ •

  • @BackToBackSWE
    @BackToBackSWE  6 років тому +38

    Table of Contents:
    Addressing Temporal Circumstances 0:00 - 0:11
    The Problem Introduction 0:11 - 1:30
    Outlining Our Subproblems 1:30 - 2:50
    Defining Our Base Cases 2:50 - 3:45
    Establishing Our Subproblem Relationship 3:45 - 4:31
    We Are Ready: Filling Out The DP Table 4:31 - 10:28
    Time Complexity 10:28 - 10:40
    Space Complexity 10:40 - 11:10
    Wrap Up 11:10 - 11:23
    The code for this problem is in the description. Fully commented for teaching purposes.

    • @abhilakshsharma1275
      @abhilakshsharma1275 4 роки тому +1

      Couldn't find link to the code for this problem in the description ... Awesome Explanation by the way !!!

    • @BackToBackSWE
      @BackToBackSWE  4 роки тому

      thx and we only maintain backtobackswe.com now

    • @MrTafli
      @MrTafli 3 роки тому

      bro, briliant thx, but, I could not get one thing which is not explained to any videos I've searched for:
      What if the amount of change would be 6 in your case. wouldn't it fail? or am i missing something.
      for example just consider and explain to me this please:
      in case the chaneg is 6 for the cell {coins[1, 2] x change[6] } = we would have 1 + 3 = 4. (6-2=4 and on 4th collumn in current row we already have value 3 (ways) ).. that means that for change 6 if we use coins [1,2] we have 4 distinct was?! but thats not true.
      we have only 1+1+1+1+1+1; 2+2+2; 2+2+1+1; and the final one 2+1+1+1+1 is to be honest is same way as 2+2+1+1. e.g. aren't all cases all instances of (2 * n +1 * m) = C (c = any positive change value) all same ONE distinct way of forming change for that C?(where n, m are positive integers >0) ? thank you anyway!
      e.g For change 6 there should be 3 distinct wasy: 1) using coin 1 only, 2) using coins 1 & 2 any number of times 3) Using only coin 2?
      in other words, using coin1 two times and forming a change and using coin1 4 times and forming a change with same coin2 one time or two times, isn't it same unique way by using coin denominations any arbitrary times?

  • @TheinHtikeAung35
    @TheinHtikeAung35 3 роки тому +75

    "Every single dynamic programming video should start out with the explanation of the subproblem.
    This is not about table behind me. It’s about subproblem and how they relate to each other."
    Love this!

  • @phanichoragudi57
    @phanichoragudi57 5 років тому +230

    I love the way you merged your video with that of Tushar roy's. 😁

    • @BackToBackSWE
      @BackToBackSWE  5 років тому +20

      Yeah, I mess around sometimes. I've seen all the gurus.

    • @ravitanwar9537
      @ravitanwar9537 5 років тому +10

      @@BackToBackSWE you gonna become one of the gurus , then hopefully the ones watching your videos :)

    • @BackToBackSWE
      @BackToBackSWE  5 років тому +3

      @@ravitanwar9537 haha

    • @shrad6611
      @shrad6611 5 років тому +13

      but I really hate the fake accent of tushar but he also have nice explaination

    • @Yagamilight19383
      @Yagamilight19383 5 років тому +18

      @@shrad6611 he gives no explanation at all

  • @siddharthkhandelwal933
    @siddharthkhandelwal933 Рік тому +2

    Knowing a concept is one thing, but being able to explain it so well is another .Your explanations are lucid and very easy to understad.

  • @murtazaroondiwala1611
    @murtazaroondiwala1611 4 роки тому +24

    Amazing work! You explain things in a way that even a 6 yrs old child can understand. Keep it up!!

  • @xceinie
    @xceinie 2 роки тому +3

    I love how you explain this problem and the use of the disclaimer "do not memorize the patter, memorize the subproblem". Your order of explanation, repetition, knowledge of the subject, the thoroughness of your explanation and your enthusiasm are amazing! Thank you for creating this!

  • @lifeofbarkin
    @lifeofbarkin 5 років тому +91

    I’ve lost it when I saw Tushar 😂 Great work man!

    • @BackToBackSWE
      @BackToBackSWE  5 років тому +2

      my bad, old me was annoying

    • @lifeofbarkin
      @lifeofbarkin 5 років тому +4

      @@BackToBackSWE What? Noo, it was hilarious :D I love it when I see this kind of references :D

    • @BackToBackSWE
      @BackToBackSWE  5 років тому

      @@lifeofbarkin nice

    • @prachigupta2368
      @prachigupta2368 4 роки тому +3

      🤣🤣🤣🤣🤣🤣🤣🤣🤣

    • @shubhamsingh-gb5zh
      @shubhamsingh-gb5zh 4 роки тому +1

      Same here 😁

  • @amitpurohit8816
    @amitpurohit8816 4 роки тому +2

    I have recommended all of my friends who wanted to learn dp this channel.....His shear passion and excitement to teach itself crystal clears all the concepts and doubts...and of course he taught me to think about subproblems...Thank you for this wonderful explanation!!!!

  • @rahuldeshpande3516
    @rahuldeshpande3516 11 місяців тому

    Bro, I'm from Toronto. THIS RIGHT HERE IS THE BEST EXPLANATION. Most folks must just go into the table. You did everything. Thank you

  • @SV-zi9os
    @SV-zi9os 4 роки тому +4

    Great Explanation! Just loved when you described that a DP problem is not about just showing a dry run.
    Just some additions, to be precise the subproblems are -
    #ways to get a sum 'n' using S(a,b,c) set of coin = # ways of getting a sum 'n' from S (a,b) (Do not use the c coin) + #ways of getting a sum 'n' from S(a,b,c) with using c at least once (Use the c coin).
    This is true as basic set law {X union X complement is equal to universal set} therefore, doesn't matter which coin is choosen as c, therefore it doesn't matter that the order of coins is in ascending order or not.
    Now, how to ensure taking at least one coin c => use one coin of c and find #ways of getting a sum of n-c from S(a,b,c) {i.e., for getting sum n-c, it doesn't matter whether coin c was taken or not}

  • @mei.jourmi
    @mei.jourmi 2 роки тому +2

    Really love how concise and informative this video is! Instead of getting straight into coding, thank you for drawing out the table and helping us reason through it in a way that actually makes sense and is succinct!

    • @BackToBackSWE
      @BackToBackSWE  2 роки тому

      Happy Holidays! Really glad to help 🎉 Do you know about the 5 Day Free Mini Course? Check it out here - backtobackswe.com/

  • @mrkyeokabe
    @mrkyeokabe 5 років тому +2

    Thanks for the quality video. You are the most talented algo UA-camr out there!
    Note to viewers: If we call this the “unlimited” 0/1 knapsack problem (you can choose unlimited numbers of elements) and the other video Ben refers to as the “basic” 0/1 knapsack problem(you can only choose each element at most once) , the only difference between the two seems to be which cells we check with when we fill the table. For both the “basic” and “unlimited” problem, we will check the cell right above the current cell to assess the case when we don’t choose the current element. However, when we choose an element, the “basic” knapsack checks the element that is one row above and element number to the left whereas for the “unlimited” case we just look at the cell in the same row and element number to the left. I think this is a useful perspective to store somewhere in the back of one’s head.

  • @ripuvendrasingh8497
    @ripuvendrasingh8497 5 років тому +26

    Bro, my friend asked me to explain this problem even though I knew solution I messed up because explaining DP approach to someone else sucks, but your explanation is brilliant.

  • @RichardOpokuEngineer
    @RichardOpokuEngineer 5 років тому +7

    Where was this guy during my days on campus. Man, I'm impressed. Thank you

  • @avinashyadav1
    @avinashyadav1 6 років тому +13

    Thanks man, great job. Your explanation is top class. Not many people who know these problems can explain in such a manner.

    • @BackToBackSWE
      @BackToBackSWE  6 років тому +2

      Thank you. It is my mission to make things as clear as possible.

  • @tanmaymalhotra4450
    @tanmaymalhotra4450 3 роки тому

    This is why I love youtube, a person overseas just helped me understand a very crucial technique of dp .. Thank You sir, Keep making such awesome videos!

  • @rashmitharavi1205
    @rashmitharavi1205 4 роки тому +2

    I watched many videos on this problem, This one solved all my doubts. Very greatly explained. Thanks a lot!!!

  • @day1developer
    @day1developer 4 роки тому +2

    Honestly what's college without you, my school needs you! Thanks for all the great information and bringing it all together. I am adding "back to back swe" to each of my UA-cam searches now lol! Great stuff

  • @amanagarwal7849
    @amanagarwal7849 5 років тому +4

    Awesome video! Very well explained. You actually tell the concept of how to solve a dp question rather than just giving the answer.

  • @mehulkumardubey7445
    @mehulkumardubey7445 4 роки тому +1

    Explanation is very clear, thank you very much for providing better than any other paid content for free .

  • @karthikrangaraju9421
    @karthikrangaraju9421 4 роки тому +2

    @BackToBackSWE Ben, I enjoy watching your videos more than watching Netflix TV shows man! You help understand the problem so well that I can easily codify it. No need to remember solutions, only patterns!!

  • @CHIRANJIBNANDY1
    @CHIRANJIBNANDY1 5 років тому +1

    Understood it for the very first time. Thanks for the repeated and clear explanation. Loved it man.

  • @MrVenona
    @MrVenona 3 роки тому

    I've looked at a bunch of explanations for how to solve this. Yours is by far the best explanation.

  • @karthikrangaraju9421
    @karthikrangaraju9421 4 роки тому +3

    For folks who still don't understand the intuition behind "table[row][col - coins[row-1]" and "table[row-1][col]"
    Amount 5, with coins [1,2].
    There are 3 ways:
    [1+1+1+1+1]
    [1+1+1+2]
    [2+2+1]
    Can be broken down as:
    With 2:
    Deduct 2 from amount 5, then you have. sub problem which is:
    Amount 3, with coins [1,2]
    [1+1+1] = 3. Now just add 2 to it ==> [1+1+1+2] = 5
    [2+1] = 3. Now just add 2 to it ==> [2+1+2] = 5
    Without 2:
    [1+1+1+1+1]

  • @VioletteToussaint
    @VioletteToussaint 2 роки тому +1

    You are a fabulous teacher, crystal clear, thank you so much!

  • @-ali2565
    @-ali2565 2 роки тому

    One of the most clear and thoughtful explanations on the subject, thank you for spreading your knowledge, you are an excellent prof!

  • @maripaz5650
    @maripaz5650 5 років тому +24

    Beautiful, why can't my algo teacher be this good 😂

  • @zombiesalad2722
    @zombiesalad2722 5 років тому +1

    Really well put. I had no prior experience in dynamic programming and after watching this I was able to solve most of the partitions problem that I encountered. Thank you.

  • @Zainodis
    @Zainodis 4 роки тому +1

    I watched a lot of videos on knapsack and coin problem but i t hink this is the first time i actually finally understood that damn table - thank you :)

  • @shrimatkapoor2200
    @shrimatkapoor2200 4 роки тому +1

    This is much better than Tushar's video in terms of explanation, I think the explanation of using and not using the coin in the list on each step makes way more sense

  • @lavanya_m01
    @lavanya_m01 3 роки тому

    I love the way you explain stuffs so easily. I was way too confused with this approach before watching this video :) Love ya!!

  • @techsavvy1457
    @techsavvy1457 5 років тому +2

    Wow! Your channel is a gold mine.

  • @ekeminibassey6880
    @ekeminibassey6880 3 роки тому

    I needed to watch this video like over and over and over and read about dynamic programming again.

  • @mazharalibaig8548
    @mazharalibaig8548 4 роки тому +1

    Couldn't have explained it better...respect man!

  • @verushannaidoo9450
    @verushannaidoo9450 5 років тому +4

    Thank you so much for explaining this problem ;). I'm new to these tough coding problems. But this video made it so understandable.

  • @user-kj9wg2eb3x
    @user-kj9wg2eb3x 4 роки тому +2

    one of the best explanation videos. Clear as always, thank you

  • @vanshajsingh9736
    @vanshajsingh9736 5 років тому +4

    Damn i just started dynamic programming and i am so grateful i came across your videos! you just explained so flawlessly! Keep up the great work man!

  • @tiagostutz2049
    @tiagostutz2049 3 роки тому

    Best explanation I found about this Coin Change problem, focusing on the subproblem... awesome.! ❤️

  • @harkigill-YT
    @harkigill-YT 6 років тому +1

    Very clear explanation what the table actually means. Very much needed as a self taught software engineer! Thank you

    • @BackToBackSWE
      @BackToBackSWE  6 років тому +1

      You are welcome. I want to thank you for even giving me your attention because that matters to me. So thank you, I wish you success.

  • @souravsikaria4387
    @souravsikaria4387 4 роки тому +1

    Best explanation one can find. Keep it up brother!!!

  • @kalravsharma178
    @kalravsharma178 5 років тому +3

    Your explaining power is very appreciable.Nice video.

  • @PetiaDavidova
    @PetiaDavidova 5 років тому +9

    I wish I could subscribe again, that's how good this channel is!

  • @eddiemanman2
    @eddiemanman2 3 роки тому

    haha ive watched your coin change problems probably like 10x now. Idk i keep forgetting the method behind the madness. Thank you so much for making these videos though :) As a non commsci major, I''m super grateful you're making these videos! -headed into my google phone screen tmr

  • @ashutoshyadav9637
    @ashutoshyadav9637 3 роки тому

    Wow ! finally someone explained how the tabular method works. Thanks :)

  • @dhruvroytalukdar7942
    @dhruvroytalukdar7942 4 роки тому +1

    your explanation is really good and easy to understand...this is really helpfull please make more videos like this...

  • @akashkirthik9882
    @akashkirthik9882 3 роки тому

    THE BEST explanation I've seen ! Awesome !

  • @freeBirbBirb
    @freeBirbBirb 11 місяців тому

    i appreciate your passion, best explanation and grid for ways to make change

  • @찌요-z1t
    @찌요-z1t 2 роки тому +1

    thx bro! you've helped me a lot! I was struggling to understand this problem quite a long time. Goood work!

    • @BackToBackSWE
      @BackToBackSWE  2 роки тому

      Awesome! Try our 5 day free mini course for some great content backtobackswe.com/

  • @ShashiBhushan2k13
    @ShashiBhushan2k13 4 роки тому +1

    Understood that if amount is 0, only one way to select coins i.e. choose nothing. On the other hand, if number of coins to choose is 0, there's no way to choose any coins, hence 0.
    However, in an overlapping case of if the amount is 0 and there are no coins to choose, why it's one way (value for table[0][0])
    By the way, recently started following your videos. love your unique style of presentation on difficult topics. Feels like reading a well written documentation :D

    • @BackToBackSWE
      @BackToBackSWE  4 роки тому +1

      It is hard to justify, it just makes the recursion "work". We could conceptualize a justification if we wanted to and that'd be fine. and thx

  • @dhara2814
    @dhara2814 4 роки тому +1

    This is such a clear explanation...thanks a lot. The best video on coin combinations explanation.👍

  • @portlandsound1
    @portlandsound1 4 роки тому +3

    Dude, thank you so much for your videos. You are such a natural teacher! : )

  • @priyanksharma1124
    @priyanksharma1124 5 років тому +1

    This guy is just brilliant. Superb job brother

  • @markovchains573
    @markovchains573 2 роки тому

    God bless you for this clear explanation I was struggling for hours

  • @ruzaik.rafeek
    @ruzaik.rafeek 2 роки тому

    THIS IS THE BEST DP PROBLEM EXPLANATION EVER. THANKS!

    • @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 😀

  • @ishanshah3309
    @ishanshah3309 5 років тому +2

    This is second video after o/1 knapsack i've watched of this guy. I really appreciate ur work. U are making it easy for beginners in dp like me to understand the logic as well as recurrence relation which is very important in dp. Thank you again for great explanation. I hope u make more and more videos on dp and other competitive programming topics.

    • @BackToBackSWE
      @BackToBackSWE  5 років тому +1

      Hey, this guy here. Thanks for coming by

  • @silambarasan.ssethu9367
    @silambarasan.ssethu9367 3 роки тому

    Got the algo concept in ur video after failed attempts in understanding the same in two different videos.That said, u r clearer to me

  • @AK-dr2md
    @AK-dr2md 3 роки тому

    I struggle to understand iterative approaches towards dp problems. your video was great help! thanks ben!

  • @tribhavchaudhary4745
    @tribhavchaudhary4745 5 років тому +1

    best explanation to a dp problem i have ever seen.

  • @LuisGuilhermeJGomes
    @LuisGuilhermeJGomes Рік тому

    I finally could understand how to solve this problem that I had seen in SICP book. Thank you guys

    • @BackToBackSWE
      @BackToBackSWE  Рік тому

      Happy Holidays 🎉 Thank you for your kind words, Luis! We'd love to offer you a 40% Off our exclusive lifetime membership just use the code CHEER40 - backtobackswe.com/checkout?plan=lifetime-legacy&discount_code=CHEER40

  • @varunsaini246
    @varunsaini246 4 роки тому +1

    I love the video as well as the fact that you always like viewers comment.

  • @tanzidulislam7687
    @tanzidulislam7687 5 років тому +2

    You sounds like my Zoology teacher. He told us that "If I repeate a line many times, it will hit you minimum once". That's might be the reason for what I was able to understand what he was saying at the very last second of explanation. Take love ❤

  • @zhaowencheng8690
    @zhaowencheng8690 4 роки тому +1

    Every video is so clear!

  • @rishabhsinha3713
    @rishabhsinha3713 4 роки тому +1

    How can someone think like this dude, amazing.

  • @legendry
    @legendry 4 роки тому +2

    Magnificent explanation!
    Sir,keep it up!

  • @azzochie3373
    @azzochie3373 3 роки тому

    You are saving my time of solving this problem by myself! Thank you ^^

    • @VishalKumar-kr9me
      @VishalKumar-kr9me 3 роки тому

      You should first try by yourself, then you should watch solutions.

  • @michaelchan6144
    @michaelchan6144 4 роки тому +3

    Hello Ben, please could you explain the line: table[row][col-coins[row-1]] from your whitboard.
    I know this is the logic for what you do when you use choose to use the current denomination in question and SHIFT LEFT instead of going up but I'm not sure specifically how the coins[row-1] section of the above logic works because the way you do it in the video is just coins located at (Current Amount - Denomination in question) without shifting the row.

    • @BackToBackSWE
      @BackToBackSWE  4 роки тому

      I don't remember to be honest. I'd need a refresher, I shot this long ago.

    • @whatsinaname8450
      @whatsinaname8450 4 роки тому

      Micheal, I understood your query
      So, if we do not use the coin, then we do not subtract the sum amount (because we do not use the coin), in the event when we use the coin, then our sum also decreases by that coin amount

    • @mathavraj9378
      @mathavraj9378 4 роки тому

      Adding to @Sushree Moharana , the reason why the pattern for choosing a coin is table[row] [col - coins[row - 1] ] instead of table[row] [col - coins[row] ] is because we are accounting for the no coins row (the first row in the table) we added. Remember it was not explicitly an entry in the original coins array. Also don't confuse using the two equations at the edge of the table (first row and first column), they are initial conditions we start with for the dynamic problem solution. They are like the base cases in recursion. @Michael Chan

  • @aravindk8181
    @aravindk8181 4 роки тому +1

    everyone can be coder , if not they are missing a teacher like u

  • @scarlettz7986
    @scarlettz7986 4 роки тому +1

    I love you ! I love your explaining ! crystle clear!

  • @ricojia7322
    @ricojia7322 4 роки тому +1

    Great Video and I like that passionate vibe in your video!!

  • @franky0226
    @franky0226 4 роки тому +1

    Man! You rock ❤️, you have exceptional teaching capabilities

  • @iSkvort
    @iSkvort 4 роки тому +1

    Bravo super clean explanation, one note I think for [] 0 - we can set it as 0 and it will make more sense

  • @AzharKhan-wn8wy
    @AzharKhan-wn8wy 2 роки тому

    Best explanation. Clear, concise. Thanks 👍

  • @vartikasinghania9723
    @vartikasinghania9723 3 роки тому

    I love the way how he is teaching :D.....thank you

  • @allankong7114
    @allankong7114 Рік тому

    amazing how well you teach!! Thanks for great work you do!

  • @vishwastak471
    @vishwastak471 4 роки тому +1

    great video dude...was stuck on this one for the whole day!!

  • @rafidahmed1885
    @rafidahmed1885 9 місяців тому

    BEST EXPLANATION EVER!

  • @patricklown3388
    @patricklown3388 5 років тому +4

    Thanks for putting out awesome videos! I think it would more informative on DP questions if you went through and developed the recursive formula before diving into the table. The explanation is on point but there was no explanation why we would use DP in the first place. For someone who had never seen the problem before, they wouldn't be able to instantly identify it as DP and determine the table structure and what the sub problems are. I think approaching the problem and determining why DP is necessary would be helpful.

    • @BackToBackSWE
      @BackToBackSWE  5 років тому

      I made a page dedicated to things like this: backtobackswe.com/im-sorry

    • @kellyxiao3060
      @kellyxiao3060 5 років тому +1

      @@BackToBackSWE I agree with Patrick Lown, maybe explain how to come up with DP programming for solving this problem. Really like your amazing video

    • @BackToBackSWE
      @BackToBackSWE  5 років тому

      @@kellyxiao3060 thanks

  • @B96106001
    @B96106001 5 років тому +2

    holy shit, I just learning dynamic programing and searching how to make dp table. this video is so easy to understanding. thanks a lot!!

  • @umutzaferersoy8874
    @umutzaferersoy8874 4 роки тому +4

    Great explanation! Thank you...

  • @nishant_mittal
    @nishant_mittal 3 роки тому

    Thank you so much!! Love from India.

  • @davidguo1964
    @davidguo1964 3 роки тому

    God bless this man for his videos

  • @shashwatagrawal8412
    @shashwatagrawal8412 4 роки тому +1

    Simply awesome dude ! Keep going ! Really helps having your videos!!

  • @matthewtsang8268
    @matthewtsang8268 6 днів тому

    Notice that a generating function also works! we can use an infinite number of 1p, 2p and 5p so (1+x+x^2+x^3+x^4+x^5...)(1+x^2+x^4...)(1+x^5...) and expanding only exponents of x^5 gives 4x^5 = 4 ways :>

  • @girishthatte
    @girishthatte 4 роки тому +1

    Awesome explanation... I just like the way you present the problem thinking approach 👍💯

  • @yiyiliu2537
    @yiyiliu2537 2 роки тому

    You have made these problems soooooo easy to understand!!!

  • @ridhisood4951
    @ridhisood4951 5 років тому +1

    you make these problems easy to understand!!! thanks for all your efforts :)

  • @suthakark1816
    @suthakark1816 4 роки тому +1

    Best teacher superb explanation

  • @zhouchong90
    @zhouchong90 5 років тому +2

    It's amazing how you understand algorithms in this much depth, while still doing undergrad in school!!!
    I got a master's degree and 4 yoe, still learning algorithms from you. Thank you for sharing, and keep the good videos going!

  • @maheshvangala8472
    @maheshvangala8472 5 років тому +2

    Sir please make more videos on dynamic programming
    Data structures and algorithms
    It will help lot of students.
    Your videos are very good

  • @danielebanana
    @danielebanana 2 роки тому

    Love your videos! Very easy to understand! Thank you!

  • @ramachandragopalposina3943
    @ramachandragopalposina3943 4 роки тому +1

    I just Have a doubt here is it possible to return all the possible combinations in a list using this dp approach? Can anyone help me with this?

  • @ohhdannyyboyy2919
    @ohhdannyyboyy2919 5 років тому +1

    Awesome video! I think a follow up that would be cool is to optimize this problem with the O(A) space complexity and maybe explain how and why we can optimize it the way we can sort of continuing on from here! Thanks for the vids! Keep up the good work!

  • @Aravind994
    @Aravind994 4 роки тому +1

    I thought of buying the premium version but could not find this problem listed in your problems list. I could find only the (coin change 1 leetcode version)

    • @BackToBackSWE
      @BackToBackSWE  4 роки тому

      yes - we haven't ported all problems over and have some tabled for a reshoot

  • @nicholas8219
    @nicholas8219 4 роки тому +2

    Hi, great video, super detailed and easy to follow! I have one question though: For the minimum coin change question, you didn't split up the subproblems the way you are doing it now. Would the solution path you are following in this video be viable to solving the problem you solved in the fewest coin change problem you had in the other video? And if so, why?

    • @BackToBackSWE
      @BackToBackSWE  4 роки тому +1

      Thanks and no it wouldn't, the subproblems here are different. While this is about the inclusion and exclusion of the ability to use a certain coin at different amounts - The Coin Change Problem is about just trying coins at each amount with no exclusion.

    • @nicholas8219
      @nicholas8219 4 роки тому

      @@BackToBackSWE ohhhhhh ok, gotcha! How did you determine that exclusion played a part in your solution path? Did you just see that it was a combination problem and immediately thought exclusion?

  • @王冠信-o1c
    @王冠信-o1c 2 роки тому

    One comment that I was using the algorithm on the Hackerrank preparation kit, each coin in the array must be less or equal to the target amount. Otherwise, the algorithm breaks. Thank you for the clear explaination.

  • @rajeshbammidy180
    @rajeshbammidy180 4 роки тому +1

    Thanks for adding Tushar!

  • @lavishgarg4274
    @lavishgarg4274 5 років тому +1

    Thanks you bro,for making such a great video,in no words i can be more thankful to you,🙏🙏🙏

  • @raisulahsan2019
    @raisulahsan2019 2 роки тому +1

    Every single dynamic programming video should write out the underlying recurrence relation

    • @BackToBackSWE
      @BackToBackSWE  2 роки тому

      Sure, try out our 5 day free mini course for some cool stuff backtobackswe.com/

  • @deepabalasundaram6747
    @deepabalasundaram6747 3 роки тому

    Thanks a lot for your videos Ben! I can see the subproblems in many DPs now!

  • @sahilgupta1640
    @sahilgupta1640 4 роки тому +1

    can we have a top down dp approach(memoization) of this problem?