DP#2: Coin Change Problem Number of ways to get total | Dynamic Programming | Algorithms

  Рет қаралды 369,146

Jenny's Lectures CS IT

Jenny's Lectures CS IT

5 жыл бұрын

Correction: @16:20 in coin 5 and weight 6 intersection it should be 2, at coin 5 and weight 11 intersection it should be 4, at coin 10 and weight 6 intersection it should be 2, in coin 10 and weight 11 intersection it should be 4
This video talks about coin change problem using dynamic programming with example. Given infinite supply of coins of different denominations and certain amount. how many ways these coins can be combined to get the given amount.
What is Dynamic Programming | How to use it
• DP-1: What is Dynamic ...
See Complete Playlists:
Placement Series: • Placements Series
Data Structures and Algorithms: https: • Data Structures and Al...
Dynamic Programming: • Dynamic Programming
Operating Systems: // • Operating Systems
DBMS: • DBMS (Database Managem...
Connect & Contact Me:
Facebook: / jennys-lectures-csit-n...
Quora: www.quora.com/profile/Jayanti...
Instagram: / jayantikhatrilamba

Пікірлер: 373
@JennyslecturesCSIT
@JennyslecturesCSIT 5 жыл бұрын
CORRECTION: @16:20 in coin 5 and weight 6 intersection it should be 2, at coin 5 and weight 11 intersection it should be 4, at coin 10 and weight 6 intersection it should be 2, in coin 10 and weight 11 intersection it should be 4. I hope you guys got this correction. :)
@ShaliniSingh-xc5rn
@ShaliniSingh-xc5rn 4 жыл бұрын
Yes mam
@kushagraagarwal3297
@kushagraagarwal3297 4 жыл бұрын
Code you have written will give a segmentation fault as you are referring to the index of a[i-1] and i is 0; Thanks.
@SunilKumar-hu3ow
@SunilKumar-hu3ow 4 жыл бұрын
Can u post the code if possible as iam unable to write the code for the first row
@xavierxavier97
@xavierxavier97 4 жыл бұрын
Thx for this video, but u have mistake in first for loop. U cannot have j + 1: twoDimensional[i][j] = twoDimensional[i-1][j] continue if j + 1 - coins[i] == 0: twoDimensional[i][j] = 1 + twoDimensional[i-1][j] continue if j + 1 - coins[i] > 0: twoDimensional[i][j] = twoDimensional[i-1][j] + twoDimensional[i][j-coins[i]] print(twoDimensional) coins = [2,3,5,10] doMatrix(mince2,15)
@swetas6431
@swetas6431 4 жыл бұрын
@@xavierxavier97 hi mince 2 means???
@ramziadil8613
@ramziadil8613 2 жыл бұрын
You are the best! You explained this so clearly! It was so helpful that you explained what the rows, columns, and what each cell represented as well as the strategy for calculating the values. I was so confused when my professor lectured about it, but in so little time, I learned a lot from you! THANKS SO MUCH!!
@ihsandag7405
@ihsandag7405 2 жыл бұрын
I have never seen a more clear explanation for this popular problem. I'd wish to have all my instructors like you back in time. Now I stand and clap this great instructor. Thanks!!!
@umeshreddy6971
@umeshreddy6971 Күн бұрын
wohh galat heii BC
@Jhjh7724
@Jhjh7724 2 жыл бұрын
this is super helpful, especially the exclusion and inclusion part, keep up the good work!
@GianfrancoYosida
@GianfrancoYosida 2 жыл бұрын
you are amazing, it's enjoyable how you teach these concepts in a so simple way!
@harshitprose7319
@harshitprose7319 5 жыл бұрын
finally i found a grt vedio with some good explanation .
@MiddleEasternInAmerica
@MiddleEasternInAmerica 3 жыл бұрын
Thank you so much Jenny, much love and respect for you and all Indians from Egypt
@asifking3714
@asifking3714 2 жыл бұрын
Thank you mam and for those who are saying they didn't get this explanation try to concentrate on board more...everything here is crystal clear ❤️❤️
@devayz9305
@devayz9305 3 жыл бұрын
You're the best Jenny, THANK YOU!
@bharatkumarshukla3743
@bharatkumarshukla3743 4 жыл бұрын
Ma'am thank you so much your lecture really helped me understand the algorithm behind this problem. Though I was able to implement the algorithm I still have one doubt as to what was the logic behind including the coin step? Though I was able to implement it but couldn't understand it very well. Thanks.
@alixaprodev
@alixaprodev 4 жыл бұрын
12:52 when you are saying fine. This is the best style i have ever seen. just enjoying your way of teaching.
@XxKingfisherxX
@XxKingfisherxX Жыл бұрын
Thanks Jenny! This is the best video i've seen on this topic!
@maneeshbhakuni6195
@maneeshbhakuni6195 4 жыл бұрын
Thanks Jenny , that was an awesome explaination indeed. :)
@adityaprasadsahu1458
@adityaprasadsahu1458 Жыл бұрын
Hats off to you mam, literally you are far far better teaching from our college professor to whom we are paying lakhs of rupees. Bow down for your deliberate teaching and the way you are teaching. If this kinda teaching we gonna get we will definitely fall in love with DSA/DAA.
@MirSuhailMohammad
@MirSuhailMohammad 3 жыл бұрын
Beautifully explained. Appreciate your Work Ma'am.
@graham12345dd
@graham12345dd Жыл бұрын
You're a very good lecturer Bravo and thanks! I'm off home now to code this in c++. THANK YOU!!
@rushabhsinhsolanki5350
@rushabhsinhsolanki5350 3 жыл бұрын
You and your way of teaching are just Awesome... Great Explanation.... Thanks for it.....👍👍👍👍👍
@MM-ib6qh
@MM-ib6qh 2 жыл бұрын
Wow, you are an amazing teacher. Thank you!
@Damarnadh13
@Damarnadh13 3 жыл бұрын
Thank you ... Your explanation helped me alot for understanding of logic clearly..
@get2lalitsingh
@get2lalitsingh 5 жыл бұрын
Wonderfully explained, Jenny.
@adityanjsg99
@adityanjsg99 7 ай бұрын
Explained with enormous patience!
@bajracha
@bajracha 4 жыл бұрын
Thanks for such a clear explanation and detail walk through of the problem.
@JennyslecturesCSIT
@JennyslecturesCSIT 4 жыл бұрын
thank you so much
@chengchen3074
@chengchen3074 10 ай бұрын
love you ! never meet a teacher such clearly and good!
@TuxHouseEdu
@TuxHouseEdu 4 жыл бұрын
thank you so much!!! Greetings from Greece.
@vivekdhage8296
@vivekdhage8296 4 жыл бұрын
Solved......from you.....this.....is...lit🔥🔥🔥thanks for helping us
@deepakprajapati5064
@deepakprajapati5064 4 жыл бұрын
your explanation is just awesome , cleared my all doubts related to this topic. and one more thing you have a beautiful dipper eyes
@anirudhvenkataramanan4321
@anirudhvenkataramanan4321 2 жыл бұрын
Amazing explanation! keep up the good work!
@nandhakumarkr3147
@nandhakumarkr3147 4 ай бұрын
Thank you for explaining the great tricking dynamic programming to all. Your explanation made it easy . Kudos great work 🎉
@anonymous-cb2bi
@anonymous-cb2bi 3 жыл бұрын
Thank you for the simple explanation really appreciate that
@abdullahsiddiqui3118
@abdullahsiddiqui3118 5 жыл бұрын
Great, Explain very well.
@sayasark
@sayasark 5 жыл бұрын
Thank you mam,Amazing explanation.
@sudhirpratapsingh5730
@sudhirpratapsingh5730 5 жыл бұрын
Superb explanation , Thanks a lot .
@personalsolutions5658
@personalsolutions5658 Жыл бұрын
Thank you! Helped me solve Project Euler Nos 76 & 77 in less than 1/10 ms run time!!!👏
@flaironov
@flaironov 3 жыл бұрын
Ma'am, thankyou for clearing concepts💛
@thrilleracaste400
@thrilleracaste400 Жыл бұрын
Thank you ma'am. Wonderfully explained!
@mayankdwivedi1893
@mayankdwivedi1893 3 жыл бұрын
Thank you very much. This was extremely helpful :D
@heomappro1
@heomappro1 Жыл бұрын
Great explanation! Thanks a lot Jenny.
@antaratewary9645
@antaratewary9645 4 жыл бұрын
please make a complete series on dynamic programming.I have scourged the internet,and you are by far the best.Please help students in understanding such concepts.Thank you so much.
@JennyslecturesCSIT
@JennyslecturesCSIT 4 жыл бұрын
Few are covered and working on ..... Pls check my videos and playlist for more
@sharanreddy5658
@sharanreddy5658 3 жыл бұрын
kzfaq.info/sun/PL_z_8CaSLPWekqhdCPmFohncHwz8TY2Go
@HeyItsVishal
@HeyItsVishal 5 жыл бұрын
i wish hamare yaha itni achi teacher hoti you are great
@allamtajusarof5649
@allamtajusarof5649 2 жыл бұрын
very clear, no hesitation, really understandable. love this lecture... thank you for creating a great videos. 🧡🧡
@vasugupta4745
@vasugupta4745 4 жыл бұрын
Wow, wish you would have made them almost one year ago..I would have scored 100/100 in DSA..still thanks ..pls keep making such useful videos..Great method of explaining...❤️ ❤️ ❤️ ❤️
@NEERAJSINGH1
@NEERAJSINGH1 4 жыл бұрын
it was really helpful ..thank u so much
@jimwoodward7293
@jimwoodward7293 4 жыл бұрын
Very nicely explained -- thank you.
@emascochukwujindu5528
@emascochukwujindu5528 2 жыл бұрын
Pure gold! I just subscribed!
@riteshtadvi544
@riteshtadvi544 3 жыл бұрын
Thank you so much madam... I missed my ADA lecture Then i found your Videos Very Useful For Me.
@ManishGupta-xi5kd
@ManishGupta-xi5kd 4 жыл бұрын
thank you , you way teaching is awesome .i like it
@nknidhi321
@nknidhi321 3 жыл бұрын
Ma'am you are super awesome.. Thank you for the content..❤️🙏
@varaprasadkurra6361
@varaprasadkurra6361 3 жыл бұрын
Perfect Explanation of Backtracking. Thank you
@Sasikumar-kr7xy
@Sasikumar-kr7xy 4 жыл бұрын
Expecting more videos related to dynamic programming or coding related problems.
@tanaytapanshu9839
@tanaytapanshu9839 3 жыл бұрын
The way you algos ma'am is really amazing
@abhishekjaiswal6492
@abhishekjaiswal6492 3 жыл бұрын
Great explanation mam, you did clear everything..
@vasugupta4745
@vasugupta4745 4 жыл бұрын
I think DSA (specifically DP) is the only part in coding where most of IT professionals lack skills to code because most of the teachers aren't able to explain clearly, but through your videos, you can help every young IT professional to understand these concepts better
@shivamkotnala155
@shivamkotnala155 3 жыл бұрын
Thanks you so much ma'am, solid explanation,plz add more video in this playlist ma'am.
@utkarshsrivastava9236
@utkarshsrivastava9236 5 жыл бұрын
Please make on some advance DP problem also you are awesome...loved the way you explain
@tourwithkausik7730
@tourwithkausik7730 4 жыл бұрын
Beauty with Brain. deadly combination....Thank you so much mam, You just save me from my biggest obstacles.....
@retrogame3138
@retrogame3138 4 жыл бұрын
You doing great job please make a video on how should crack the interview of product based company
@user-zn2hr3ci9z
@user-zn2hr3ci9z 2 жыл бұрын
Thank you very much. Your lectures are best and really save my algorithms course at university. Without your lectures, I will probably fail my course. Can you pls make vedios on backtracking algorithms and related problems like N-queens and Sudoku in the future? Thank you for your great lectures:)
@alphaman3765
@alphaman3765 3 жыл бұрын
wonderful explanation.Pls do include such videos
@asifnewaz8732
@asifnewaz8732 4 жыл бұрын
Thanks jenny...the explanation was pretty gd
@RiyaSingh-mq1vb
@RiyaSingh-mq1vb Жыл бұрын
Thank you for the explanation!!
@Algo-gr7xz
@Algo-gr7xz 3 жыл бұрын
Thanks a lot madam.Your explanation is very good and helpful for us
Жыл бұрын
So happy mam thank You soooooo much 🙌🏻🙏🏻 God Bless You ☺️
@mahamatdjibrine95
@mahamatdjibrine95 2 жыл бұрын
Thank you Mam , Please keep it up . You are really great 🙏
@rudraduttsisodiya3101
@rudraduttsisodiya3101 4 жыл бұрын
I already know this, still watched full video. Just because the way you teach it. Thank you. Please keep on uploading make studying interesting.
@Finn-jp6pn
@Finn-jp6pn 5 жыл бұрын
Can we use the Top Down Approach (recursion + memoization) to solve this problem? Are there situations where we'll choose one DP approach and not the other? Thanks
@thesuperiorman8342
@thesuperiorman8342 4 жыл бұрын
Thank you for this step by step guide. I was struggling to understand how to formulate the table but I think I grasped it now.
@sarahbavan3959
@sarahbavan3959 26 күн бұрын
Thank you Jenny! lots of love
@srikantsharma6430
@srikantsharma6430 4 жыл бұрын
Very well explained!
@reshyasudhiv8105
@reshyasudhiv8105 Жыл бұрын
Super mam..I I'll become a best professor award in my college ..really you I'll helping me a lot.. very much big fan of your work..thank you once again mam..
@jiganeshpatil1472
@jiganeshpatil1472 4 жыл бұрын
Best tutorial channel ever
@rahulchaubey8988
@rahulchaubey8988 4 жыл бұрын
Very good explaination.. Thanks
@maverickhackers783
@maverickhackers783 Жыл бұрын
Thank you so much mam ,i watched this video in almost four channels but i wasnt able to get a proper idea about how to proceed but your explanation made it very easy for me to understand
@JennyslecturesCSIT
@JennyslecturesCSIT Жыл бұрын
Happy to help
@soumyadiptabanerjee8256
@soumyadiptabanerjee8256 4 жыл бұрын
Mam your way of teaching dp is great..Plz make more videos..
@srujanwankhede5314
@srujanwankhede5314 3 жыл бұрын
TYSM mam it was very helpful of you to explain so deep. Please keep explaining such algorithmic questions.
@srujanwankhede5314
@srujanwankhede5314 3 жыл бұрын
also in the first for loop their should be ( i < len(coins) )
@tufanpondu9511
@tufanpondu9511 9 ай бұрын
Thanks mam Finally i understand the coin change problem.🧑‍💻🧑‍💻
@s.r.s__3809
@s.r.s__3809 4 жыл бұрын
Great explanation thank you mam.
@marvinraval3917
@marvinraval3917 5 жыл бұрын
Thanks it was excellent mam 🙂
@deepakchaturvedi3596
@deepakchaturvedi3596 4 жыл бұрын
Hi Jenny, The explanation is very good. but i think this logic will not work as in for loop you are initializing i = 0 and j =0 and in if else block you are using a[i-1] && a[j-1]. If i will start with i =1 and j =1. how can i get the first row values ? Can you please help here
@HelloBangladesh389
@HelloBangladesh389 10 ай бұрын
Thanks a lot Apu............ It's great for understanding
@maheshvangala8472
@maheshvangala8472 5 жыл бұрын
Please make more videos on algorithms especially dynamic programming Good explanation thanks a lot
@rajasekharreddy805
@rajasekharreddy805 4 жыл бұрын
How do we do if coins are duplicate ? is it possible using dynamic programming
@phatphamminh6361
@phatphamminh6361 2 жыл бұрын
Its so useful, thank you so much
@ankushyamkar3602
@ankushyamkar3602 3 жыл бұрын
Thank you mam❤️ for such kind of explanation ,but my question is how did u get the logic behind this problem
@nimishgupta749
@nimishgupta749 4 жыл бұрын
Dhansu explaination. Keep it up 👏
@anirudhgahlot6361
@anirudhgahlot6361 5 жыл бұрын
Excellent loved it
@pratikkorat790
@pratikkorat790 3 жыл бұрын
Really formula looks to scary but you explained it in observation method....salute.. regards from ld college of engineering...😌
@vivekpaliwal1876
@vivekpaliwal1876 5 жыл бұрын
Good Explanation...main logic is clear but how to the make first row in program? that 1,0,1,0,1,0 kind of.
@myroncarvalho4872
@myroncarvalho4872 5 жыл бұрын
at 16:18 for coin 5 and weight 6 there are 2+0 possible ways to get 6. it's written 3? even logically 2+2+2 and 3+3 are the two possible ways no third way to get 6 using coins of 2,3 and 5.
@JennyslecturesCSIT
@JennyslecturesCSIT 5 жыл бұрын
Yes it would be 2...by mistake I wrote 3.. Just follow the formula and u will get 2..btw thanks for this correction
@myroncarvalho4872
@myroncarvalho4872 5 жыл бұрын
@@JennyslecturesCSIT yes I was solving along so stumbled on that difference. Thanks for the videos. Helped a lot!
@maheshv18
@maheshv18 2 жыл бұрын
Great content!!!
@borat_trades2860
@borat_trades2860 4 жыл бұрын
best all covering tutorial
@risabhkedia2685
@risabhkedia2685 3 жыл бұрын
I write very few comments on youtube. But really your work is commendable. Jai ho Jenny didi ki 😁😁
@libitard
@libitard 2 жыл бұрын
I want to thank you for explaining why Amount 0 is always 1. I have watch other videos and they never explain it the way you do. Thank you very much.
@hetvifuria7174
@hetvifuria7174 2 жыл бұрын
why is it 1?
@vinodkumar-ds2po
@vinodkumar-ds2po 4 жыл бұрын
Perfect!
@vishukohli1109
@vishukohli1109 4 жыл бұрын
Very good explanation
@marvinalone
@marvinalone 3 ай бұрын
9:45 why just copy the above value when coin value > w? how can I understand from a DFS tree view?
@KunalKumar-ex9gm
@KunalKumar-ex9gm 4 жыл бұрын
Dear ma'am u r just awesome!!!!!!!!!!!!!!!!!!!
@pranavkumar9943
@pranavkumar9943 5 жыл бұрын
👍👍very nicely explained. Please make videos on backtracking.
@shahrooz_akp1420
@shahrooz_akp1420 Жыл бұрын
very nice, thank you.
@eshikasaxena6936
@eshikasaxena6936 3 жыл бұрын
Very easy explanation.
@maidul13
@maidul13 4 жыл бұрын
thank you so much
DP#3 : Change Problem-Minimum number of coins Dynamic Programming
27:13
Jenny's Lectures CS IT
Рет қаралды 235 М.
Java Is Better Than Rust
42:14
ThePrimeTime
Рет қаралды 156 М.
Самый Молодой Актёр Без Оскара 😂
00:13
Глеб Рандалайнен
Рет қаралды 11 МЛН
Spot The Fake Animal For $10,000
00:40
MrBeast
Рет қаралды 164 МЛН
Solve Any Pattern Question With This Trick!
57:20
Kunal Kushwaha
Рет қаралды 2,3 МЛН
AES: How to Design Secure Encryption
15:37
Spanning Tree
Рет қаралды 154 М.
Floating Point Numbers - Computerphile
9:16
Computerphile
Рет қаралды 2,3 МЛН
0/1 knapsack problem-Dynamic Programming | Data structures and algorithms
27:31
Jenny's Lectures CS IT
Рет қаралды 1,2 МЛН
the "natural habitat" of a quadratic curve
31:02
Michael Penn
Рет қаралды 1,9 М.