DP 14. Subset Sum Equals to Target | Identify DP on Subsequences and Ways to Solve them

  Рет қаралды 434,040

take U forward

take U forward

Күн бұрын

Пікірлер
@takeUforward
@takeUforward 2 жыл бұрын
I need your support, and you can do that by giving me a like, and commenting "understood" if I was able to explain you. Note: Please add a check for arr[0]
@riderpd09
@riderpd09 2 жыл бұрын
Just love the meta of solving subsequences by "take" and "not-take" :) A big US!!!
@amishasahu1586
@amishasahu1586 2 жыл бұрын
Understood Sir
@kiranbari6284
@kiranbari6284 2 жыл бұрын
i think subset sum also can be done using only one array......as you did in knapsack problem....
@anonymousvoid6356
@anonymousvoid6356 2 жыл бұрын
Huge big understood!!!!
@manishprajapati8544
@manishprajapati8544 2 жыл бұрын
mera full support bhai 👍👍👍
@nityanandbhaskar2155
@nityanandbhaskar2155 Жыл бұрын
Just a edge case correction. dp[0][arr[0]] could give out of bound exception if arr[0] > target. So use a check for that.
@devsrivastava2300
@devsrivastava2300 Жыл бұрын
that won't be an edge case as initially the whole dp is marked false in tabulation method
@Pirates571
@Pirates571 Жыл бұрын
​@@devsrivastava2300 that will be an edge case if arr[0] is greater than the half of total sum then it will be out of bounds
@jayendraawasthi2646
@jayendraawasthi2646 Жыл бұрын
@@devsrivastava2300 assume arr[0] = 1000 and target is 10. It will give error.
@devsrivastava2300
@devsrivastava2300 Жыл бұрын
Oh ok got it , thanks
@muditkhanna8164
@muditkhanna8164 Жыл бұрын
keen observation.
@ParodyCSEDept
@ParodyCSEDept 8 ай бұрын
Tbh in most of the previous 13 problems, I was intuitively able to guess the DP recurrence relation (without thinking about recursion and all). However for this question, intuition didn't kick in. Then, I remembered your words that if I can write a recursive solution for the problem then after following your steps, I will be able to reach the DP solution. So I did follow all the steps and yeah I really was able to reach the most optimal solution for this on my own. Hats off to you Striver! Understood!
@anshpradhan1954
@anshpradhan1954 4 ай бұрын
You know what's cool about his teaching method, it actually works, he boiled down a complex topic like DP to mere steps which you just have to execute and reach the optimal solution, hats off to this man
@VarshaSingh-hi2sb
@VarshaSingh-hi2sb 4 ай бұрын
Why we are taking a 2 d dp array and not 1 since we are given a 1 d array? is it because both target and index are changing?
@ParodyCSEDept
@ParodyCSEDept 4 ай бұрын
@@VarshaSingh-hi2sb yes we consider all indices as well as all targets because they help us to reach the final answer.
@prnvtj
@prnvtj 7 күн бұрын
@@VarshaSingh-hi2sb yes. we choose the array dimensions based on the number of parameters changing.
@tanmay9928
@tanmay9928 2 жыл бұрын
Had to watch the video multiple times in order to fully understand this concept. In all seriousness, there are so many key points to be kept in mind when learning this concept.
@charanteja2407.
@charanteja2407. Жыл бұрын
Can anyone list those key points here
@ankitadas5833
@ankitadas5833 2 жыл бұрын
Understood! you ended the video by submitting space optimization code at Morning 02:53 AM,,,,, How much energy you have 😱😱😱😱. Hats off to your dedication.
@takeUforward
@takeUforward 2 жыл бұрын
Thanks for noticing ♥️
@RajeevKumar-fb3in
@RajeevKumar-fb3in 2 жыл бұрын
😱😱
@RajeevKumar-fb3in
@RajeevKumar-fb3in 2 жыл бұрын
You also saw his video 02:53 AM😱
@shiblijamal8544
@shiblijamal8544 Жыл бұрын
3am is like heaven time to code❤
@lakshsinghania
@lakshsinghania Жыл бұрын
@@shiblijamal8544 can't stress more on this
@dsp-io9cj
@dsp-io9cj Жыл бұрын
dp[0][arr[0]]=1; in this what if arr[0] is greater than target, coz given constraints are arr[i]
@AD-fs6hr
@AD-fs6hr 7 ай бұрын
Correct. I suppose the test cases in Coding Ninjas are made such that, target is always greater than first element. otherwise it would have thrown error.
@chetanthakral5322
@chetanthakral5322 2 жыл бұрын
I think he is missing a if case , if arr[0] >=k , then we would be getting a sigsegv runtime error. To remove that we can replace dp[0][arr[0]] = true; by if(arr[0]
@takeUforward
@takeUforward 2 жыл бұрын
Corrected in the next video. Thanks.
@elements8630
@elements8630 2 жыл бұрын
I was confused about this part. thanks, bud!
@rishabhtater889
@rishabhtater889 2 жыл бұрын
but why in the first place dp[0][arr[0]]=true is mentioned?
@pk4288
@pk4288 2 жыл бұрын
@@rishabhtater889 when we reach index 0 and target left is equal to arr[0] then only we will return true otherwise it will be false. so in tabulation we are initializing like that only
@rishabhtater889
@rishabhtater889 2 жыл бұрын
@@pk4288 so in tabulation, we are assuming it to be true only? Then we'll move forward?
@zeroanims4113
@zeroanims4113 Жыл бұрын
27:58 this is a very important point to understand. I wrote the recursion slightly different from striver (i start from 0 -> N) meaning the top of my recursion is 0 and the bottom is N. So my dp bottom up nested loop is from n-1 going to 0, and will return dp[0[[k], it should still work code: bool dpWay(int n, int k, vector& arr){ vector dp(n+1, vector(k+1, false)); for (int i = 0; i = 0; i--){ for (int j = 1; j = arr[i]) take = dp[i+1][j-arr[i]]; dp[i][j] = skip || take; } } return dp[0][k]; } bool rcMemoWay(int i, vector& nums, int tar, vector& memo){ if (tar == 0) return true; if (i == nums.size()) return false; if (memo[i][tar] != -1) return memo[i][tar]; bool skip = rcMemoWay(i+1, nums, tar, memo); bool take = false; if (tar >= nums[i]) take = rcMemoWay(i+1, nums, tar - nums[i], memo); memo[i][tar] = skip || take; return memo[i][tar]; }
@GauravThinks
@GauravThinks 10 ай бұрын
yahi dhund raha tha mai bhai ♥
@parthsalat
@parthsalat 2 жыл бұрын
Time complexity: Recursion: 19:37 Memoization: 22:20 Space optimization: 36:44 Code: Recursion: 29:32 Memoization: 30:52 Tabulation: 33:15
@bhoomikagajpal674
@bhoomikagajpal674 7 күн бұрын
Amazing!!!! Couldn't understand this for 6 years and 1 day you made it seem so easy!!!!!!
@swapan6785
@swapan6785 Жыл бұрын
Nicely explained! Had to do dry run multiple times for full understanding. It seems very tough to directly write tabulation/space optimization method, but easy when starting from recursion and following the order.
@arpitrajput6424
@arpitrajput6424 2 жыл бұрын
hey! we can add one more line to reduce further looping if we get our ans add if(dp[ind][k]==true)return true; at before end of second loop try it. vector dp(n,vector(k+1,false)); for(int i=0;i
@mr.jacker3951
@mr.jacker3951 Жыл бұрын
was Asked in Google last year in Interview
@GManiKarthik
@GManiKarthik 24 күн бұрын
The first time, I tried to understand this concept by just watching the explanation 🧑‍🏫👀. I assumed I could skip deeper thinking and would grasp it in future lectures of this pattern 🤔➡📚. But no, my mind wasn’t cooperating 🤯. So, I decided to watch it again 📺, this time actively solving along with pen and paper ✍📄. After that, I mastered it and now feel very confident 💪✨! #Understood #DP14 #Hatsoff #Striver
@ajith4249
@ajith4249 Жыл бұрын
Tabulation burra padu . Super oo
@MohammadKhan-ld1xt
@MohammadKhan-ld1xt 2 жыл бұрын
Before starting this dp series, I was really confused as to which playlist I should follow as there were many good playlist , but after listening to first 2 lectures, I knew that this is the best dp playlist I could ever find and this includes the paid courses too. I have paid courses but I prefer this. I am addicted to this playlist. Seriously!!! Hats of to you bhaiyya🔥Keep striving and good luck. Hope to see you on the right path..
@k4ranjith
@k4ranjith 2 жыл бұрын
Understood, Very well explained. the best DP playlist. Thanks for taking time and making the videos.
@_sk99
@_sk99 3 ай бұрын
The way he teaches is fabulous!.... I love his enthu
@SriAdiNarayanaReddySabbella
@SriAdiNarayanaReddySabbella 5 ай бұрын
Understood! Tabulation is tricky in this one a little bit. But, your explanation just made it so easy. Thank you so much for this amazing series ❤
@VarshaSingh-hi2sb
@VarshaSingh-hi2sb 4 ай бұрын
Why we are taking a 2 d dp array and not 1 since we are given a 1 d array? is it because both target and index are changing?
@SriAdiNarayanaReddySabbella
@SriAdiNarayanaReddySabbella 4 ай бұрын
​@@VarshaSingh-hi2sbThe DP array that we take in a question is not at all related to the array that is given to us. As you said, since we can have multiple function calls for the same index with different targets, we are maintaining a 2D DP array. For example, in [1,2,3,4,5] with target 10, if we pick 5 at index 4, then from index 3 onwards, our target will be 10-5=5, if we don't pick 5, then target will remain the same i.e. 10. Since at the same index, function calls are made for different targets, to optimise them, we need to have a 2D array for every possible target at every possible index. Hope it helps!
@rijumondal6876
@rijumondal6876 Жыл бұрын
He is probably one of the most genius guy I ever come across
@roshangupta8161
@roshangupta8161 2 жыл бұрын
Understood each and everything!!!Thanks for this amazing Dp series.
@Abhijeet-st4bj
@Abhijeet-st4bj 2 жыл бұрын
bhai why dp[ind+1][target+1]?? why not dp[ind+1][target+1]??
@deviprasad_bal
@deviprasad_bal Жыл бұрын
@@Abhijeet-st4bj do you mean why not dp[ind][target] ??
@kevinthant2952
@kevinthant2952 11 ай бұрын
So far to me, you are the best explainer of algorithm questions on the whole Internet. Thank you so much for your amazing work on these explanation videos. 🙏🙌
@lambar0
@lambar0 2 жыл бұрын
Your energy and passion for breaking it down is commendable… thanks
@HEMANTPORWAL-t7d
@HEMANTPORWAL-t7d 5 ай бұрын
in tabulation why dp[0][arr[0] ] is equal to true
@HEMANTPORWAL-t7d
@HEMANTPORWAL-t7d 5 ай бұрын
understood
@a_05_himanshu_akula31
@a_05_himanshu_akula31 Жыл бұрын
in tabulation base case we gotta take care of the case where arr[0] > k else dp[0][arr[0]] will go out of bound since dp is set to range of 0 to k
@gudlaudaysai4571
@gudlaudaysai4571 Жыл бұрын
I am about to write this, glad you had asked it and i can confirm that my approach is correct
@vishious14
@vishious14 Жыл бұрын
Quick question. Can you explain why we are marking dp[0][arr[0]] as true.
@swapan6785
@swapan6785 Жыл бұрын
@@vishious14 try doing dry run and you will get it. Basically dp[0] means we are checking only till first element (0th index in arr) and answer would be true only if arr[0] = target, otherwise false.
@priyanshubansal6820
@priyanshubansal6820 2 жыл бұрын
This is the best dp solving technique that I have ever seen. thank you for giving us this wonderful playlist
@shivambajaj7640
@shivambajaj7640 7 ай бұрын
In two days, I am able to convert my recursive solutions to iterative. All thanks to you!
@rahulpothula1902
@rahulpothula1902 2 жыл бұрын
Everything understood perfectly!! But a small doubt in tabulation: why did we directly write dp[0][arr[0]] = true without checking the condition if(arr[0] == k)??? Pls pls pls answer if anyone knows....🙏
@aaryan3461
@aaryan3461 2 жыл бұрын
same doubt
@codingachinilgtifirbhikrrh9009
@codingachinilgtifirbhikrrh9009 2 жыл бұрын
it is a reminiscence of the base condition which we used in recursion i.e. if(i==0)return arr[0] = target
@georgemullarj
@georgemullarj 2 жыл бұрын
dp[0][arr[0]] means n=0, means only 1 element i.e., arr[0] present in array and the target is arr[0]. Since target and element is same it is true. I feel 1 based indexing is more easy to understand, see Aadity verma videos for it.
@abhishekgururani6993
@abhishekgururani6993 2 жыл бұрын
Listen, in your base case for recursion you had condition that when "index will be 0" and "value of arr[0] will be equal to target" you'll return true. In tabulation, dp is represented like this : dp[index][target], so the value of dp when "index equals 0 and target equals arr[0]" is true;
@tusharsahu397
@tusharsahu397 2 жыл бұрын
Same Doubt...........as arr[0] can be any large value then how can we take it as index of a fixed size dp??
@stith_pragya
@stith_pragya 11 ай бұрын
UNDERSTOOD..................Thank You So Much for this wonderful video..........🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
@RahulKushwah-sv9rh
@RahulKushwah-sv9rh 2 жыл бұрын
Raj bhaiya rocks ☄☄☄ from beginning to this video I never felt that this is the same topic in which previously I faced a lot of problem to solved the question.
@takeUforward
@takeUforward 2 жыл бұрын
Areh video th dekh lo :|
@RahulKushwah-sv9rh
@RahulKushwah-sv9rh 2 жыл бұрын
Woh toh smj aa hi jayegi bhaiya aap Padhye ho😀
@ramyasree4986
@ramyasree4986 2 жыл бұрын
in recursion time complexity is always no of changing states and possibilities (all stuffs) this we further reduce from exponential using memorization and with tabulation we remove stack space and with space optimisation we do reduce array dimension woww!!!! so clear explanation
@aman9633
@aman9633 2 жыл бұрын
What if n=1,k=5 and arr[0]=10 ,when we are doing pre[arr[0]] ,as arr[0]>k won't it go out of bounds??
@takeUforward
@takeUforward 2 жыл бұрын
Yes true, correctly pointer out. Thanks. For that reason we need to write another check condition.
@satyamraj2779
@satyamraj2779 6 ай бұрын
or rather you can just do this for(int i = 0; i
@smitboraniya6752
@smitboraniya6752 2 жыл бұрын
At first I thought your methos is very obvious, but as we go further in dp playlist it proves to be much stronger tool to apply for solving tough problems.
@Rohit-zk1lz
@Rohit-zk1lz Жыл бұрын
"what's bottom up ulta ulta"
@shivangpandey9943
@shivangpandey9943 Жыл бұрын
We can use a base case as if(target < 0) return false; this will help us to escape through edge case of bool take call
@RoyBoyLab
@RoyBoyLab Жыл бұрын
yes
@amitghosh4548
@amitghosh4548 2 жыл бұрын
I've submitted the Top-Down version with 1D memo and still got accepted... vector memo; bool knapSack(int i, int sum, int K, vector &A) { if (i < 0) return false; if (sum >= K) return sum == K; if (memo[i] != -1) return memo[i]; if (knapSack(i - 1, sum + A[i], K, A) || knapSack(i - 1, sum, K, A)) memo[i] = 1; return memo[i] == 1; } bool subsetSumToK(int N, int K, vector &A) { memo.assign(N, -1); return knapSack(N - 1, 0, K, A); }
@sushant8686
@sushant8686 2 жыл бұрын
i don't how this is working because for index we two choices how will you know which choice is giving me right and which is giving wrong ?
@boomburstshorts2347
@boomburstshorts2347 Жыл бұрын
why we have taken target + 1 while constructing vector .......dp ?
@mridul.7183
@mridul.7183 Жыл бұрын
because else only we will be able to store till target-1. but to store till target, we took target+1.
@parthsalat
@parthsalat 2 жыл бұрын
Note that striver changed the color of the curtains behind him from this video onwards. Hence from now onwards, all remaining videos of the playlist are very imp
@lalitchahar1068
@lalitchahar1068 10 ай бұрын
it took time to understand it but it worth every second fabulous explaination thank you soo much for these high quality videos..🤗
@snipercool4169
@snipercool4169 2 жыл бұрын
[Java] Tabulation Solution : public class Solution { public static boolean subsetSumToK(int n, int k, int arr[]){ // Declaring dp array. boolean dp[][] = new boolean[n + 1][k + 1]; // If required sum = 0, answer always true. for (int i = 0; i
@pritamiitismdhanbad561
@pritamiitismdhanbad561 Жыл бұрын
one issue you have to also add else dp[i][j]=dp[i-1][j]
@nagame859
@nagame859 Жыл бұрын
understood! just the recurrence tree is enough to understand this problem.. which again.. you explained it in the best way in the recursive series.. props to you 👏 🙌 🙏
@anything_jara_hatke5237
@anything_jara_hatke5237 2 жыл бұрын
When I took a 2D global vector of size n*k max values i.e 1e3*1e9, I am getting Segment error. But when I don't define it globally and take it as a parameter of function, than it is working fine, can I get its explanation please.
@DhananjayKumar-bd2jg
@DhananjayKumar-bd2jg 2 жыл бұрын
29:51 why we are taking size k+1 rather than k?
@takeUforward
@takeUforward 2 жыл бұрын
One based indexing
@legendsoflife3955
@legendsoflife3955 2 жыл бұрын
he tried to do little bit good but the main intuition of this approach is missing, I still feel Aditya Verma explained it in a more better way.
@oliverlowcy
@oliverlowcy 2 жыл бұрын
Had trouble understanding bottom up approach till I saw this vid. Thanks a lot!
@adityajain1205
@adityajain1205 2 жыл бұрын
Bhaiya you said that if it gets a true in recursion , further recursion will not take place. But we are returning in the end so i think full recursion will take place . Correct me if i am wrong...
@dakshjainth3212
@dakshjainth3212 5 ай бұрын
thank you sir for this amazing video and in-depth explanation "US"
@anything_jara_hatke5237
@anything_jara_hatke5237 2 жыл бұрын
Value of k is max 1e9 and N is 1e3, I don't think we can take 2D array as dp instead of vector, right?
@epicsportsplay-c7w
@epicsportsplay-c7w 10 ай бұрын
understood Sir .From DP Video 1 I was watching video in that mean time
@sujalgupta6100
@sujalgupta6100 2 жыл бұрын
i am little bit confused . when and why do we take size = n+1 sometimes while making dp[n+1 ] and sometimes we only take dp[n]
@subhashpabbineedi7136
@subhashpabbineedi7136 2 жыл бұрын
I think, if there is 1 based indexing we take n+1 or else n
@harishchandra8057
@harishchandra8057 2 жыл бұрын
@@subhashpabbineedi7136 correct
@Codebreaker0702
@Codebreaker0702 Жыл бұрын
Did u get your answer ?
@sujalgupta6100
@sujalgupta6100 Жыл бұрын
@@Codebreaker0702 yes kunal , I take n+1 size everytime, because it works fine most of the time.
@deviprasad_bal
@deviprasad_bal Жыл бұрын
in this question you can take n instead of n+1 , it'll work. basically we decide that by looking at the range of indices covered. here it was from 0 to n-1 , hence it covered n indices and hence we declare it as vectordp( n , vector(k+1,-1); k + 1, because target ranges from 0 to k.
@priyanshuchouhan9845
@priyanshuchouhan9845 Жыл бұрын
the lecture was amazing . This took my concept of dp at next level.
@ScienceSeekho
@ScienceSeekho 2 жыл бұрын
For tabulation, In second for loop why are we going upto target? for(int ind = 1; ind
@manishkumar-nh9jo
@manishkumar-nh9jo 2 жыл бұрын
because array indexing is from 0 to n-1 for n sized array. here row represents the index of the array and col represents the target.
@Pandey_Puja
@Pandey_Puja Жыл бұрын
I didnt understand the logic behind below line of code Please note that it can happen that arr[0]>target, so we first check it: if(arr[0]
@es_amit
@es_amit 9 ай бұрын
24:27 to convert easily recursive to tabulation Read below 1) if you have an array of size 0 and target 0, what will be the output ? ---- true because we have no elements and have no target. This is the case of dp[0][0] 2) if you have an array of any size and target 0, output -- true because we will not pick any of the elements in the array. case ---- dp[allrows][0]. 3) if you have an array of size 0 and target not equal to 0 , output ----- false because we have no elements to pick and achieve target ---- dp[1][allCols].
@urvashiparmar4856
@urvashiparmar4856 2 жыл бұрын
Thanks!
@priyanshuchouhan9845
@priyanshuchouhan9845 Жыл бұрын
I understood all the concepts that you taught in this lecture
@sachinNotOut
@sachinNotOut 10 ай бұрын
you have already explained this in recursion playlist i think and this time you solved this by combination sum problem pattern from that recursion playlist
@abdalla4425
@abdalla4425 Жыл бұрын
Did a dry run for the tabulation and space optimization that allowed me to understand the code, with a lil more practice, I will be able to come up with this without the video like how I did with recursion and the memoization solution! Thanks
@bahveshjain1730
@bahveshjain1730 2 жыл бұрын
understood bhaiya becoz of u i am able to solve dp questions easily now .
@piyushmathpal4244
@piyushmathpal4244 8 ай бұрын
Getting runtime error in tabulation approach? For those who are not able to run tabulation code in online editors (due to addition of edge case), add this check while initialising dp[0][arr[0]] :: if(arr[0] dp[ind][10].
@sairam3351
@sairam3351 Жыл бұрын
Understood, Thank you so much.
@piyushsaxena6243
@piyushsaxena6243 2 жыл бұрын
understood, this is the best dp playlist indeed
@MukeshKumar-cc3uh
@MukeshKumar-cc3uh 10 ай бұрын
Sir, you are amazing. Understood. ♥
@hashcodez757
@hashcodez757 4 ай бұрын
"UNDERSTOOD BHAIYA!!"
@ritikshandilya7075
@ritikshandilya7075 6 ай бұрын
Thanks Striver for great solution
@minhthang93
@minhthang93 Жыл бұрын
To more simplify the recursion to easy to understand: private static boolean recursion(int index, int target, int[] arr) { if (target == 0) return true; if (index < 0) return false; if (target < 0) return false; boolean take = recursion(index-1,target-arr[index],arr); boolean notTake = recursion(index-1,target,arr); return take || notTake; } But the way Striver do is help you save some recursion call -> his code will faster
@parthsalat
@parthsalat 2 жыл бұрын
Understood! Now you can peacefully go back to sleep 😴
@shashwatkumar6965
@shashwatkumar6965 7 ай бұрын
In the second base case in tabulation if dp[0][arr[0]] = true, this means that at 0th index, the value stored in 0th index of arr will be true. So cant we do the same thing for all indices, ie dp[1][arr[1]] = true, similarly, dp[2][arr[2]] = true and so on. So, we can do this inside the for loop of the first base case for(int i = 0; i < n; i++){ dp[i][0] = true; dp[i][arr[i]] = true; }
@madhav3444
@madhav3444 2 жыл бұрын
Why you started the outer for loop from index 1 to n and not 0 to n in the tabulated dp calculation 31:33 ? , I know it will give Runtime error but I am not getting intutuion for this. Thanks
@rounakraj6276
@rounakraj6276 2 жыл бұрын
understood also the minor change in the last part of video is imp as it gives runtime error on leetcode if it is not changed.
@rounakraj6276
@rounakraj6276 2 жыл бұрын
@Arjun search subset sum equal to target leetcode ... U will find the similar ques
@koushikvss7638
@koushikvss7638 2 жыл бұрын
Is the corresponding question on leetcode 560. subarray sum equals K?
@SajanKumar-ec2us
@SajanKumar-ec2us 8 ай бұрын
understood ! **please discuss in sort video how you became a expert coder?
@aarushirai6374
@aarushirai6374 2 жыл бұрын
Understood. Brilliantly explained. You clear the concepts to the core.
@DilpreetSingh-cs7yz
@DilpreetSingh-cs7yz 2 жыл бұрын
At 21:00 why there is +1 to index and target?
@anikethdeshpande8336
@anikethdeshpande8336 2 жыл бұрын
best explanation.... drawing recursion tree really helps understand better !
@radekszewczyk3603
@radekszewczyk3603 8 ай бұрын
Understood! Thanks man!
@karthikmg3325
@karthikmg3325 Жыл бұрын
Happy Teacher's day to Striver ❤🎉
@TanviPoddar-f1k
@TanviPoddar-f1k 7 ай бұрын
At 26:36, why is the index starting from 1? We haven't filled the entire 0th row, right? So shouldn't it start from 0?
@MayankLC93
@MayankLC93 2 жыл бұрын
space optimization is out of world !!!!!!!!!!!!😂😂😂 Aweosme Explanation ..
@dharmeshpoladiya9047
@dharmeshpoladiya9047 2 жыл бұрын
Understood 💯💯 Great Explanation. Thank you very much for all you efforts🔥🔥
@abhijitbandgar8112
@abhijitbandgar8112 Жыл бұрын
Understood raj sir
@piyushsharma2798
@piyushsharma2798 Жыл бұрын
25:06 i don't understood please someone explain
@disunique6107
@disunique6107 2 жыл бұрын
Last one was greattt 🔥 GOAT
@Morimove
@Morimove 11 ай бұрын
bhaiya aapko matrix table bana ke samjana chaiye tha. memoization mei sirf matrix bana dene se solve toh ho gaya bas samj hi nahi aaya ki kaise ho raha hai. laga jaise jaadu ho raha hai. fir kisi aur ki video dekhi toh pata lga ki kaise matrix table mei values fill hoti jaati hai aur subproblems hat jaate hai. space otimized vala bhi tabhi samj aaya jab matrix table bana ke dekhi. baki aap acha content toh banate hi ho toh keep going. 😄
@priyanshuchouhan9845
@priyanshuchouhan9845 Жыл бұрын
I have seen all previous videos of this dp series
@udayprakashharsh2805
@udayprakashharsh2805 Жыл бұрын
Understood but having a slight doubt shouldnt we add if(notTake) dp[n][k] = true; as it is goona save us a lot of recursive calls if target is less than arr[n] thenpick call will be called even though there is not need for it
@वीलवइंडिया
@वीलवइंडिया 2 жыл бұрын
Understood bhaiya... Thanks😊
@ashokbabug47
@ashokbabug47 2 жыл бұрын
Even I know the solution I will see your videos because of your thought process
@azizazmir2159
@azizazmir2159 Жыл бұрын
Words of striver matter more than looking screen ❤
@priyanshuchouhan9845
@priyanshuchouhan9845 Жыл бұрын
this is the amazing dp journey to me.
@ntgrn-pr5yx
@ntgrn-pr5yx Ай бұрын
understood, thank you striver
@vikasbagri1225
@vikasbagri1225 2 жыл бұрын
understood this and the last question were not easy
@kathanvakharia
@kathanvakharia Жыл бұрын
Understood...Completed 14/56
@AngadSingh97
@AngadSingh97 10 ай бұрын
Thank you Striver bhai..
@gouravmukherjeee6950
@gouravmukherjeee6950 2 жыл бұрын
Thank you bhaiya for these wonderful videos ❤️❤️
@shauryatomer1058
@shauryatomer1058 2 ай бұрын
thanks for this amazing content
@student_03
@student_03 Жыл бұрын
understood sir great explanation
@shreyashtech8556
@shreyashtech8556 9 ай бұрын
bro doing gods work
@viraj701
@viraj701 7 ай бұрын
can we use the combination sum ii (recursion L-9) approach to solve this problem using dp?
@105avniuplabdhee5
@105avniuplabdhee5 Жыл бұрын
understood
@parthsalat
@parthsalat 2 жыл бұрын
Continue from 22:30
@shaik1525
@shaik1525 10 ай бұрын
Understood bhaiyya.......
DP 15. Partition Equal Subset Sum | DP on Subsequences
9:43
take U forward
Рет қаралды 227 М.
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
8 patterns to solve 80% Leetcode problems
7:30
Sahil & Sarra
Рет қаралды 463 М.
DP 13. Cherry Pickup II | 3D DP Made Easy | DP On Grids
43:23
take U forward
Рет қаралды 248 М.
How To Actually Achieve Your Goals in 2025 (Evidence-Based)
15:15
9 Count of Subsets Sum with a Given Sum
20:49
Aditya Verma
Рет қаралды 365 М.
Dynamic Programming isn't too hard. You just don't know what it is.
22:31
DecodingIntuition
Рет қаралды 210 М.
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН