I was doing the Algorithmic Toolbox course on Coursera taught by world class Professors from world famous universities. Your DP playlist is 1000% better than their way of teaching DP. Lots of love and luck man!
14 years later...now i am solving DP by looking at the questions. Blessed to have people like you on platforms like this and keeping content free for all. Hope to see you become next Linus trevoldus.
15 of 50 (30%) done! The more you summarize, the more trivial it becomes! Simply awesome! Categorizing the problems makes it easier to compare code with parent patterns and their variations.
bhai algorithm aur data structure pe sare videos daal do , aap boht acha padha rahe , i hope u get 1 million views . I am watching your videos and they are helping me so much . The degree to which your content covers the simplicity of the problem and the connection between different problems is remarkable . Your videos focuses primarily on concept building and a planned approach for solving problem rather then memorizing the code. Really salute you brother . Boht acha kaam kar rahe aap Verma ji.
@@TheAdityaVerma Hello bhaiyya. can you please tell how you can say that in this video for sum 5 ----> 2+2+1 is different than 2+1+2.Please bhaiyya explain
@@expansion_forever it is not different,both are same, to get 5 with [1,2] coins denomination . there are three ways they are [1,1,1,1,1] , [1,1,1,2],[1,2,2] . observe that [1,2,2] is same as [2,2,1] , [2,1,2] we are not counting these extra. Note: all coins in input will be unique. I hope I am clear
I solved this question without watching your this video... I was able to solve it by using the older concepts that you taught... This is what that makes you different from other channels that just rote learn the code without understanding the underlying hidden concept and just make a video claiming themselves as a tutor and launching paid courses.. plus your video is always straight to the point without any bs... I sincerely wish you the best of luck. Kudos to you :)
can't thank you enough!! today it was my DAA lab exam + viva i completed your DP videos related to Knapsack and its variations. Similar question came in the exam and the whole time I was writing the code, I was thanking you from the bottom of my heart. You are my saviour thanks man!!
Aditya, please create graph playlist. You're doing such a great job. No future engineer can ever make a better playlist on DP. You're definitely the best. Love the way you built the logic in our head.
@@dhawalbhende1250 bro nhi code execute nhi hota mene bhot try kiya ...agar hota to ans galat ata he ...tu agar gfg pe inke method se solve kiya he to plz share
Thanks, Aditya, your playlist is wonderful. I've shared it with all my groups. I'm now able to code most DP problems with your style without being lost in what the table needs to be. For this problem, I read that the space complexity can be reduced further. In essence, we don't use the size of the array( coins list dimension). Initialization: Same as your 0th row of the table for the same reasons 1. Iterate through all coins one at a time 2. The minimum sum a coin can do is its value, so start from coin's value -> N in the array (of all sum) 3. As we move ahead towards N, we say the current count is looking up the current_sum-coins_value in the previous part of the array. [Most important step] 4. Repeat this for every coin, because that way you are looking at coin interactions that were happening in different rows in our original table. Maybe you can use your style and talk about this micro-optimisation in another video.
Yar tm jab padhate ho na it's like apna koi friend padha rha. So natural, so easy, ki ek moment bhi boring na lge and ek ek word tgdii level pe grasp kr paye. Thank you for covering this complicated topic with so another level of simplicity 🙏🙏🙏God bless you!
Thank you so much aditya for the tremendous explaination,the way you explain and approach problems is practical and quite different than other youtubers.Being a professional also,till date dp was nightmare for me.but after watching your content,it's goona really work for me.I appreciate your efforts in making such good videos.
Bro, you are teaching so well that without even watching the video, I got ac in gfg that too within 10min. Thank you so much bro for your effort. Pehle dp se bohot darr lagta tha par ab pyar sa hogaya hai. Please keep going bro and make more tutorials like these.
day 7:15/50 video completed Bhaiya unbounded knapsack ke bad videos dekhne ki jarrorat hi naa padi. God level explanation Maine striver bhaiya ki dp series bhi dekhi thi starting ke time but Aditya Verma🥰🥰🥰
Kudos to you!!! You taught so well that I was able to do this one without looking the solution though it is my first time of solving dp problems.....Great explanation
And this was the question which was asked to me in okCredit interview. I couldn't crack it. Now coming through the playlist, I am able solve it without the explanation. Thanks a lot for this awesome course..!!
It's became so easy to find out the pattern, problem statements and even solutions too...that is becoz of you only..You deserve a big salute...Thank you so much for sharing your precious knowledge to us...God always bless you 🙏
Bhaiya i am seeing your dp playlist from beginnig. In starting i was struggling to think the approach on my own but as soon as i am progressing this playlist and i try to pause the video and think of the approach on my own i am improving at the logics.And i came at this video just heard the problem statement and gave a try on my own without seeing the solution and sloved the problem in one go only.
literally just simply took pen before watching this vid. wrote recursive solution and converted to tabulation just like you taught and it fucking passed all test case in one go. man thanks a trillion for making dp fun 😭😭😭😭
Thank you sir, your videos are super helpful, i was very underconfident in DP, now I'm a little sure about my approaches and I can build them and can relate them with previously solved problems ! plus the comment section is very helpful !
Really bhaiya u are gem 💎 ✨️ 💖 for us people who are scared from dp I have literally solved this and write the tabulation code in such a easy way like never this is my second time studying in first time i leaved it due to difficulty but this time i found u and my fear towards dp is already changed and it is just because of u❤❤❤ And i have also suggested my younger brother to study dp and recursion from u 😊😊🙏🙏🙏🙏🙏
Excellent explanation!!! I was totally confused. I failed some interviews and I was losing my confidence. Your videos have given me inspiration. Please upload graph videos also.
I watched his videos on Dp from starting i.e. KnapSack and reaching till this video I just watch the question and do it myself in one go error free without need to even watch the video . HATS OFF! Keep the channel going sir .
Yes you are right. www.educative.io/edpresso/coin-change-problem-2-finding-the-number-of-ways-to-make-a-sum You can see code here actually i also had the same doubt.
the logic behind this problem is logic behind 2 problems : (number of ways to find sum=k…………………………in which we just replace || by +) and (unbounded knapsack).
Awesome explanation. Hats off to u. Please make videos on Trees and Graphs as well. They would be really helpful. I really love your approach to solving such problems. I was able to solve so many problems using your approach. Thank u very very much
Dude...you're so amazing! Don't know why I never watched your videos! Thanks a lot, man. But hey, I'm not a native Hindi speaker, so would love it if you slowed your words down a bit.
Your explanations of concepts in previous videos made this one so easy to understand! End mein bhi lag rha tha is problem mein kya badi baat hai? Keep up the amazing explanations! :D Hope you cover lots of other such tricky and important problem types too!
I look at it and I can see combination sum same as coin change , aditya verma has taught so well that now we can see patterns and we are like "isme kya hi naya puchliya"
adobe nai ye pucha tha .. coins ka jagah umbrella kar dia ... or mai [i-1] kar rha answer q ny aa rha ab samjha aya... anyway thanks for all the playlist dude
Why is t[0][0] is not 1 ? You have an empty set and the value you need is 0. So there is 1 way to do it? That is what we were doing in everywhere else. is it?
dps soul is recursion but here we are mapping problems with the pattern of old dp solutions .. as a beginner one must understand the exponential recursive logic first!
i don't know why my code with max(coin[i-1] + t[i[j-coin[i-1], t[ i -1 ] [ j ]) is working properly and can someone plz explain that why we did not put t[ i ] [ j - coin[ i - 1 ] ] since this question is related to unbounded knapsack
Engrave this in stones and history will witness that best ever tutorials created for Dynamic Programming on entire planet was created by Aditya Verma. Period.
Has someone done the CSES problem - Coin Combinations 2? This problem is similar to CSES problem. But the constraints are very high. We can't declare the 2d array with that size (Locally and globally as well). Can someone help me out?
Please upload a video on how to print all the four solutions like in the video the solutions are {1,1,1,1},{1,1,2},{2,2},{1,3} can we print these subsets. Same for the subset sum problem I am able to find whether there is sum is not and if there exists a subset then how many but how to print those subsets?
For this u have to maintain an array of array to store ans and array to store the state and when we get sum equals target we got ans combination then we will store that state in ans then use backtracking to explore other states as well
Bhai your lectures are the best. I have never seen anyone teach dp or algorithms this well. If you could organize some sort of small batch where you teach I would be more than happy to subscribe and pay for the course.
Is "Count ways to reach nth stair" same as this problem ? I have written the similar code, but it is not working. Can someone please help. Question: There are n stairs, a person standing at the bottom wants to reach the top. The person can climb either 1 stair or 2 stairs at a time. Count the number of ways, the person can reach the top (order does matter)
This coin change problem is not but the same problem count of subset sum if we solve it using unbounded knapsack. In count of subset sum we use t[I][j] = t[I - 1][j - arr[I - 1]] + t[i - 1][j] but in coin change we can use t[I][j] = t[I][j - coin[I - 1]] + t[i - 1][j] , remaining code would be same.
your videos are really helpful brother you may have a lot of office work in flipcart.. Kindly make a video series on tree and graph whenever you have free time..
I was doing the Algorithmic Toolbox course on Coursera taught by world class Professors from world famous universities. Your DP playlist is 1000% better than their way of teaching DP. Lots of love and luck man!
yeah !! i had also gone through that course , but that was shit compared to way Aditya Bhaiya taught here . Mind blowing!!
Agreed! Aditya is the best :)
@@Ayushraj-by2xp totally agree bro. That I found his youtube channel when I was not getting dp concept in that course.
future m koi y comment padh ra ho bhai coursera se padhna band krdo isse better apna tym bachao
@@priyanshukumawat4142 or paise bhi
14 years later...now i am solving DP by looking at the questions. Blessed to have people like you on platforms like this and keeping content free for all. Hope to see you become next Linus trevoldus.
what u doing right now?
@@aayush5474 As he said, he is solving DP now by just looking at them.
@@gourav.barkle hahahaha
Linus Torvalds*
@@aayush5474 I had the exact same question in mind when I read this comment🤣
15 of 50 (30%) done! The more you summarize, the more trivial it becomes! Simply awesome! Categorizing the problems makes it easier to compare code with parent patterns and their variations.
bhai algorithm aur data structure pe sare videos daal do , aap boht acha padha rahe , i hope u get 1 million views . I am watching your videos and they are helping me so much . The degree to which your content covers the simplicity of the problem and the connection between different problems is remarkable . Your videos focuses primarily on concept building and a planned approach for solving problem rather then memorizing the code. Really salute you brother . Boht acha kaam kar rahe aap Verma ji.
Thanks a lot brother, share as much as you can, thats keep me motivated to do more !!
@@TheAdityaVerma Hello bhaiyya. can you please tell how you can say that in this video for sum 5 ----> 2+2+1 is different than 2+1+2.Please bhaiyya explain
@@expansion_forever it is not different,both are same, to get 5 with [1,2] coins denomination . there are three ways they are [1,1,1,1,1] , [1,1,1,2],[1,2,2] . observe that [1,2,2] is same as [2,2,1] , [2,1,2] we are not counting these extra. Note: all coins in input will be unique. I hope I am clear
There is also a DP in every problem's solution. (i.e. depends on the previous problem solution)
Thanks so much for DP playlist :)
I solved this question without watching your this video... I was able to solve it by using the older concepts that you taught... This is what that makes you different from other channels that just rote learn the code without understanding the underlying hidden concept and just make a video claiming themselves as a tutor and launching paid courses.. plus your video is always straight to the point without any bs... I sincerely wish you the best of luck. Kudos to you :)
can't thank you enough!!
today it was my DAA lab exam + viva
i completed your DP videos related to Knapsack and its variations. Similar question came in the exam and the whole time I was writing the code, I was thanking you from the bottom of my heart.
You are my saviour thanks man!!
Aditya, please create graph playlist.
You're doing such a great job.
No future engineer can ever make a better playlist on DP.
You're definitely the best. Love the way you built the logic in our head.
+1
+1
I wonder how you learned these algorithms to be able to teach in such a beautiful and meaningful manner! Great job Aditya! Keep it up. 👍
I'm watched all previous videos and I was easily able to figure out the soon for this prob. Thank you so much for this clear dp explanations
Woww thats great !! Please do subscribe and share among your friends and college to help the channel grow. Thanks !!
But bro me gfg pe jab bhi inka code likhata hoo always exception index bound dikhata hai
@@coderbuddy3875 bhai thoda sense bhi lagaya kr, samjhne ke bad to ho jana chahiye
@@dhawalbhende1250 bro nhi code execute nhi hota mene bhot try kiya ...agar hota to ans galat ata he ...tu agar gfg pe inke method se solve kiya he to plz share
@Aang thankx bro I will try again 👍👍
Thanks, Aditya, your playlist is wonderful. I've shared it with all my groups.
I'm now able to code most DP problems with your style without being lost in what the table needs to be. For this problem, I read that the space complexity can be reduced further. In essence, we don't use the size of the array( coins list dimension).
Initialization: Same as your 0th row of the table for the same reasons
1. Iterate through all coins one at a time
2. The minimum sum a coin can do is its value, so start from coin's value -> N in the array (of all sum)
3. As we move ahead towards N, we say the current count is looking up the current_sum-coins_value in the previous part of the array. [Most important step]
4. Repeat this for every coin, because that way you are looking at coin interactions that were happening in different rows in our original table.
Maybe you can use your style and talk about this micro-optimisation in another video.
He is just 2020 passout ❤️
Lakin to maine admission liya hai 2020 me
Yar tm jab padhate ho na it's like apna koi friend padha rha. So natural, so easy, ki ek moment bhi boring na lge and ek ek word tgdii level pe grasp kr paye. Thank you for covering this complicated topic with so another level of simplicity 🙏🙏🙏God bless you!
Thank you so much aditya for the tremendous explaination,the way you explain and approach problems is practical and quite different than other youtubers.Being a professional also,till date dp was nightmare for me.but after watching your content,it's goona really work for me.I appreciate your efforts in making such good videos.
Thanks a lot !! I am glad it helped you !!
your previous videos were soo good that i didn't need to watch this video more than 1 min.. you created a gem on youtube.thanks
I was able to submit this problem on gfg just after listening to the problem statement. Your teaching is just wow!!! Thanks for this series.
hy i'm not able to get the correct output in gfg..it is giving some garbage value..can u help me?
@@halchal41 Use long long while making dp matrix :
long long int count(int S[], int n, int sum) {
long long dp[n+1][sum+1];
for(int i=0;i
Bro, you are teaching so well that without even watching the video, I got ac in gfg that too within 10min.
Thank you so much bro for your effort.
Pehle dp se bohot darr lagta tha par ab pyar sa hogaya hai.
Please keep going bro and make more tutorials like these.
Glad it helped !! Please do share among your friends and college to help the channel grow !!
what is "ac in gfg"?
@@blasttrash AC stands for 'Accepted' solution.
Pyar ho gaya😂
day 7:15/50 video completed
Bhaiya unbounded knapsack ke bad videos dekhne ki jarrorat hi naa padi.
God level explanation
Maine striver bhaiya ki dp series bhi dekhi thi starting ke time but Aditya Verma🥰🥰🥰
Kudos to you!!! You taught so well that I was able to do this one without looking the solution though it is my first time of solving dp problems.....Great explanation
And this was the question which was asked to me in okCredit interview. I couldn't crack it. Now coming through the playlist, I am able solve it without the explanation. Thanks a lot for this awesome course..!!
After following the playlist from beginning I am able to solve this problem by myself . This is the best part of it , It teaches you how to think
It's became so easy to find out the pattern, problem statements and even solutions too...that is becoz of you only..You deserve a big salute...Thank you so much for sharing your precious knowledge to us...God always bless you 🙏
Bhaiya i am seeing your dp playlist from beginnig. In starting i was struggling to think the approach on my own but as soon as i am progressing this playlist and i try to pause the video and think of the approach on my own i am improving at the logics.And i came at this video just heard the problem statement and gave a try on my own without seeing the solution and sloved the problem in one go only.
You are the best teacher whom i have ever had the pleasure to learn from. Thanks a lot for creating such valuable resource for CS students.
Aditya, these tutorials are best which are available on dp, world wide. Very much grateful for your contribution
but i feel like code is remembering not understanding anyone help me is it same for you also,is there not any way to visualize it
literally just simply took pen before watching this vid. wrote recursive solution and converted to tabulation just like you taught and it fucking passed all test case in one go. man thanks a trillion for making dp fun 😭😭😭😭
Thank you sir, your videos are super helpful, i was very underconfident in DP, now I'm a little sure about my approaches and I can build them and can relate them with previously solved problems !
plus the comment section is very helpful !
This problem can be solved by changing i to i-1 in count of subsets with given sum problem.
Thank you Aditya Bhaiya for teaching Dp efficiently.
Really bhaiya u are gem 💎 ✨️ 💖 for us people who are scared from dp
I have literally solved this and write the tabulation code in such a easy way like never this is my second time studying in first time i leaved it due to difficulty but this time i found u and my fear towards dp is already changed and it is just because of u❤❤❤
And i have also suggested my younger brother to study dp and recursion from u 😊😊🙏🙏🙏🙏🙏
How one can be so good at explaning these topics at this much ease.
You nailed it, man!! You are just awesome, I had never seen before someone teaching Dp like this. Keep it up bro!!!
Excellent explanation!!! I was totally confused. I failed some interviews and I was losing my confidence. Your videos have given me inspiration. Please upload graph videos also.
Yes @aditya verma we really want a graph series from you.
pahle tough lagti thi ye problem bhi but solved this problem in 3 minutes
You are really good brother. Watching your DP playlist properly is best and simple way to learn and understand DP. Thanks a lot for this.
i just started this playlist today and from mrg i am just learning from ur vedios @Q15
Bro, If it is unbounded in the code at 14:41 has to be t[i][j-coin[i-1]] right?
now i am able to understand reality of dp in easy way thanku so much aditya
Bhai yaaar!! Love all your videos!! Please make a similar series on graph algorithms!! :')
felt like I just reborn today !! you are just out of this world !! - give me another chance I wanna learn coding again
You don't know how you are changing the life of students by your dp playlist!!✨🙏
I watched his videos on Dp from starting i.e. KnapSack and reaching till this video I just watch the question and do it myself in one go error free without need to even watch the video . HATS OFF! Keep the channel going sir .
Sir , @ 14:57 there should be t(i)(j-wt(i-1)) ,since it is an unbounded knapsack you wrote i -1
Yes you are right.
www.educative.io/edpresso/coin-change-problem-2-finding-the-number-of-ways-to-make-a-sum
You can see code here actually i also had the same doubt.
I am also having same doubt, which one will be correct!?
@@ankushbeniwal4242 I wrote the correct one bro.
****.....i did this question by myself🥺🥺🥺😧😧😧😧😧😧.....your the best💜💜
Best content on DP so far on UA-cam!!
Really Amazed to get taught these tough things very easily .Thanks man❣️
the logic behind this problem is logic behind 2 problems : (number of ways to find sum=k…………………………in which we just replace || by +) and (unbounded knapsack).
I am not gonna lie. Dynamic programming feels like magic. Seriously magic. How can something be so powerful?
Awesome explanation. Hats off to u. Please make videos on Trees and Graphs as well. They would be really helpful. I really love your approach to solving such problems. I was able to solve so many problems using your approach. Thank u very very much
Dude...you're so amazing! Don't know why I never watched your videos! Thanks a lot, man. But hey, I'm not a native Hindi speaker, so would love it if you slowed your words down a bit.
wow i was particularily scared of these questions. thanks aditya god bless u
Great work! after successfully writing code, it feels great. All thanks to you brother
Your explanations of concepts in previous videos made this one so easy to understand! End mein bhi lag rha tha is problem mein kya badi baat hai?
Keep up the amazing explanations! :D Hope you cover lots of other such tricky and important problem types too!
Thank you so much Aditya Sir ... your teaching style is too good :) Thanks alot for amazing content .
I never imagined that there will be someone who can teach so good that too dp
I look at it and I can see combination sum same as coin change , aditya verma has taught so well that now we can see patterns and we are like "isme kya hi naya puchliya"
bro help me with the combination sum4
It is a great content sanjivni for coders...👌👌
Thank you very much. You are a genius.
Best playlist of dp on UA-cam
at 10:14 it should be t[i] although it is corrected in the end.
No. He was talking about subset sum which 01 unlike the current problem which is unbounded
views>number of subscribers which reflects the quality of content sir is giving i will not share this why would i create my competitor in my class
Thanks for all videos, Really gr8 concept.
adobe nai ye pucha tha .. coins ka jagah umbrella kar dia ... or mai [i-1] kar rha answer q ny aa rha ab samjha aya... anyway thanks for all the playlist dude
ha kyuki vo 0/1 knapsack ho jayega
Bhaiya maa kasam shuru ke 3:00 min mn question samajh ne ke baad, khud se kar dya. First time dp question
Explain all the concept in detail. Very good video.
i wasted my time watching jenny lectures of dp :(
Same here. This is the best lecture on DP. Even better than Coursera ones.
Me too😢
Bhai tu shi me 👌 h Thankyou bhai for this playlist🙏
Why is t[0][0] is not 1 ? You have an empty set and the value you need is 0. So there is 1 way to do it? That is what we were doing in everywhere else. is it?
Sending love ..... thanku so much for this ♥️
i think the thing that was missed is, since its unbounded , t[ i -1][ j] + ..... will be t [ i ][ j ] . 13:30 remove i -1
this caught my attention as well. But later he clarified it :)
dps soul is recursion but here we are mapping problems with the pattern of old dp solutions .. as a beginner one must understand the exponential recursive logic first!
i solved it myself because of your amazing explanations of previous questions
i don't know why my code with max(coin[i-1] + t[i[j-coin[i-1], t[ i -1 ] [ j ]) is working properly and can someone plz explain that why we did not put t[ i ] [ j - coin[ i - 1 ] ] since this question is related to unbounded knapsack
You are great man.I did it just by looking at it
Best DP course on internet!
Engrave this in stones and history will witness that best ever tutorials created for Dynamic Programming on entire planet was created by Aditya Verma. Period.
Has someone done the CSES problem - Coin Combinations 2? This problem is similar to CSES problem. But the constraints are very high. We can't declare the 2d array with that size (Locally and globally as well). Can someone help me out?
12:57 t[i-1] need to be changed into t[i] because it's a unbounded knapsack.
Where ?? can you please explain . in which line ??
@@Debugging-Life-f4f dp[i][j] = dp[i][j-coin[i-1]]+dp[i-1][j]; this line.
boht bawal smjate ho bhaiya. Thank you so much for this clear explanations.
simple way to explain...nice thanks
Fantabulous Explaination
This is the best explanation ever. Can you please make a video on how to generate the vaild combination?
Please upload a video on how to print all the four solutions like in the video the solutions are {1,1,1,1},{1,1,2},{2,2},{1,3} can we print these subsets.
Same for the subset sum problem I am able to find whether there is sum is not and if there exists a subset then how many but how to print those subsets?
Go to Tushar Roy's video for that
Bro its the problem of backtracking not DP.
For this u have to maintain an array of array to store ans and array to store the state and when we get sum equals target we got ans combination then we will store that state in ans then use backtracking to explore other states as well
Bhai your lectures are the best. I have never seen anyone teach dp or algorithms this well. If you could organize some sort of small batch where you teach I would be more than happy to subscribe and pay for the course.
Great teaching ❤️
can anyone explain if array contains a coin of 0 denomination how the initialization will vary for first column
It should not be i-1 right? as it is unbounded
Hello..I wasn't to learning react can you suggest me from where I should learn it
man ,you taught me dp thank you so much !!
Bro you are legend.
your all videos are super i enjoyed a lot
Is "Count ways to reach nth stair" same as this problem ? I have written the similar code, but it is not working. Can someone please help.
Question: There are n stairs, a person standing at the bottom wants to reach the top. The person can climb either 1 stair or 2 stairs at a time. Count the number of ways, the person can reach the top (order does matter)
bhaiya , CSES Coin change Probelm with order / without order wala concept v btaeye na with 1D array. Thanks your Tutorials Helps A lot.
This coin change problem is not but the same problem count of subset sum if we solve it using unbounded knapsack.
In count of subset sum we use t[I][j] = t[I - 1][j - arr[I - 1]] + t[i - 1][j] but in coin change we can use t[I][j] = t[I][j - coin[I - 1]] + t[i - 1][j] , remaining code would be same.
How can we optimize further using 1D DP array? How to identify if we can further optimize the space complexity?
Aditya verma bro u became celebrity in coding World
Nyc explaination bro...graph bhi pda do yr 😅
your videos are really helpful brother you may have a lot of office work in flipcart..
Kindly make a video series on tree and graph whenever you have free time..
Do you use top down approach ?
Sir, please upload videos on concepts of Graphs and shortest path algorithms