Thankyou beta! I am glad you liked it. I also hope that you are watching till end and trying to understand the what, how and especially why of the problem. If you like our efforts, will you like to write a few words about us here (www.quora.com/How-do-I-start-learning-or-strengthen-my-knowledge-of-data-structures-and-algorithms ) Keep learning and keep loving Pepcoding😊
I do good programming, but when it comes DP, recursion I got confused. I have started my DP, Recursion journey from so-called premium channels, but all went in vain...Now I find your explanation, I am satisfied and very happy because you explain how I wanted to learn from deep. Thank you very much.
solved about 500+ questions on dsa from watching tutors in utube only but for the first time i am hitting like button from my heart...this explanation is just next level dp ka dhaga dhaga khol diya apne thank u for such content sir
for any problem, i first search on pepcoding. You are amazing Sir! Your concepts and way of teaching are more retained by me, as compared to teachings of other teachers on youtube.
I am glad you liked it. I hope that you are watching the videos till the end and trying to understand what, how, and especially why of the problem. If you like our efforts, will you like to write a few words about us here (www.quora.com/How-do-I-start-learning-or-strengthen-my-knowledge-of-data-structures-and-algorithms )
Glad you love the explanation. For better experience and well organised content sign up on nados.io and don't forget to follow us on Instagram instagram.com/pepcoding/
While you were filling in the table i found that if a column consists of true then all the cells of the columns below the specified one consists of true hence while filling in dp[r][c] we can make a check like if(c==tar and dp[r][c] == true) return "true"; which will reduce the complexity a little bit or significantly, {depending upon the test cases} By the way, the session was so engaging.
Sir, you are one the best and number one coding tutor in India. Your expertise & amazing talent in teaching is just another level. Please keep making these videos as your way of doing deep analysis and approach is just next level which is unmatched by any tutor across India. Aapka support aur blessings chahiye bas 🙏
Glad to know that you liked the content and thank you for appreciating. The love and respect which I get from you people keep me highly motivated and the same I am able to forward It to you people through my videos. So, keep motivating, keep learning and keep loving Pepcoding😊
I mean, really, itna sahi explaination mene aaj tk nhi dekha. Aap best ho. Please aur bhi algos k videos bana do please. Aap har variety k dp k problems ka video bana do yaar, dp achche se samajh aa jaayegi. It would be really helpful
Thank you for appreciating. The love and respect which I get from you people keep me highly motivated and the same I am able to forward It to you people through my videos. So, keep motivating, keep learning and keep loving Pepcoding😊
I am glad you liked it. I also hope that you are watching till end and trying to understand the what, how and especially why of the problem. If you like our efforts, we request a review - g.page/Pepcoding/review?rc
Thankyou beta! I am glad you liked it. I hope that you are watching till the end and trying to understand what, how, and especially why of the problem. keep watching and keep loving Pepcoding😊
Very good explanation! For cricket analogy, you could have chosen a subset of 4,2,6,1,3 and then said that there are ppl on the team who score ONLY 4, ONLY 2, ... or ONLY 3. That way, when you say remaining team, it is easy to visualize that a person who ONLY scores 4 cannot score 1,2,3,5, etc. -- -- this is a similar approach to when you have coins of specific denominations. Overall, you made it very easy to understand how we go to (items - 1), (sum - current elem value), etc row, col. for the include/exclude scenarios. And props to your tremendous patience in explaining the filling of all 11 * 6 = 66 cells!
Thank you sir for solving the complete table hence providing a detailed and understandable explanation. I wanted to ask whether it will be sufficient to provide this (tabulation) approach in a technical interview.
Beautiful Explaination! Initially I used the Two Pointer Algo. 4/5 test cases passed could have never thought of this approach but abb aaisa related question aaya toh apna cricketer SIX maarega!
This really means a lot, Thank you for your immense support and the most important thing you guys liked it. For much better content visit on nados.pepcoding.com, you can also post such query on community tab. Don't forget to follow us on Instagram instagram.com/pepcoding/
Awsome Video!!!! Sir, ek doubt h.. meine jab isko solve karne k approach liya meine.. Dp ke rows mein Sum li..(0-10) aur columns mein (0-6) ..code bhi accordingly chnage kiya h...but answer ni aa rha..koi solution bhi ni mil rha Internet pe iska..Ye pata kaise chalega ki rows mein kisko lena h aur ol mein kisko lena h?
kisi ko hickhi aa rahi background me.. amazing work sir i had been struggling with this coin change and entire tabular form of dp ... i get the recursive dp very easily but the itravtive one i havent found anyone better than you so thank you sir ...
Haha..that was really nice😋😂 I am glad you liked it. I hope that you are watching the videos till the end. If you like our efforts, will you like to write a review about us here - g.page/Pepcoding/review?rc
Thankyou beta! I am glad you liked it. I also hope that you are watching till the end and trying to understand the what, how, and especially why of the problem. If you like our efforts, will you like to review us here - g.page/Pepcoding/review?rc
wah sir wah !!!! batting team run what a fantastic explanation i couldn't stop myself from putting comment. DP, graph is toughest pls cover too many ques on these topics. and yes pls do memoization (recursive approach) also. from 500 subs to 5k subs i m seeing the transformation!!
Thank you. Bro, linkedin ya fb pe ek post daal do channel ki. Bacho ko pta chal jaega. Will redo all DP in memoization as well. Par sath nahi, video bhot lambi ho jaegi.
Feedback : Sir i think agar cricket wala concept na lakar normal samjhate to jaldi Samajh aata. Cricket wale se little bit confusing lag raha tha. Btw great Content sir Thank you so much ❤️
Sir i had one confusion that using this approach how can we print that subset. Will we be inserting it into the vector right when we get true in the starting...matlab ye h ki i am not able to locate that how we will do this.
Sir first question mei dp ka use ache se smjh aa gya tha kyuki apne ache se smjhaya tha k hme us question ko sove krne k liye dp kyo use krni chaiye. Sir vaisi he explanation( mtlb ye k dp regular approach se better kaise h) agr is question ki bhi mil jati to isme dp ka use ache se smjh ata. vaise ab video to bn chuki h , pr aap dp ka use pls ya to comment section mei bta dijiye ya discription mei.( Pta nhi km jo khna cha rha hu vo aap is comment se smjh payenge ya nhi)
Beta, I regret to inform you that, I won't be able to answer/solve the personal doubts of each and every student over here. For clearing your doubts, you can join our community on telegram - t.me/pepcoding.
Thankyou beta! I am glad you liked it. I hope that you are watching till the end and trying to understand what, how, and especially why of the problem. If you like our efforts, will you like to write a few words about us here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )
For better experience and well organised content. visit - nados.pepcoding.com Also you can post your query on community tab. Don't forget to follow us on Instagram instagram.com/pepcoding/
sir apke notes me likha hai """for negative numbers , make dp where columns range from -target to target """" yeah samaj nhi aarha , negative numbers ko kaise handle kre .... sir mene khud se dry run kia h to yeah result nikla hai ki array me agar negative values hai then,... array ki max value jitne columns banege ( + - dono me) . ex arr is 4 , 3 , -2 , 5 and target is 3 then columns will be -5 to 5 ... is it right sir ? correct me if not.. sumeet sir @pepcoding
Sir ek request, after I watched first 2 DP videos, I was able to do next 2-3 questions on my own, but then this came so I was afraid that why this approach didnt strike, should I be afraid, I keep thinking that do other good students figure it on their own or watch solution video and this makes me anxious towards learning and creates self doubt, It would be great if you tell in the video that this question was difficult without a hint, I mean please in a line tell that this question I didnt expect you to do if you havent done before.. Being a coder I guess you must be able to understand this anxiety. Thankyou Sir.
Beta abhi aap jab tak 100-200 dp k questions khud se na kar lo tab tak it will be too soon to expect from yourself ki aap har question khud se attemp kr pao. To abhi har question par time spend kro zda se zda aur jab lge ki ab zda dimaag nh chal rh to tab jaa k solution dekh lo. Aise krne se kya hoga ki dheere dheere apki thinking capability bdegi aur jb itne question kr loge to fr aap jab koi nya question uthaoge to ye figure kr paoge ki ye question kis strategy se hoga ya kis trh ki dp bnani pdegi isme.
Thankyou beta! I am glad you liked it. If you like our efforts, will you like to write a few words about us here (www.quora.com/How-do-I-start-learning-or-strengthen-my-knowledge-of-data-structures-and-algorithms )
I am glad you liked it. I also hope that you are watching till end and trying to understand the what, how and especially why of the problem. If you like our efforts, we request a review g.page/Pepcoding/review?rc You can subscribe to our channel here th-cam.com/users/Pepcodingabout?view_as=subscriber
very well explained...But I am wondering whether this is possible only when target is small enough. How about if the numbers in the array are like [200,300,45,487,454] and target is 500. Filling 500 column table can be more time complex r8?
Thankyou! Buddy, I regret to inform you that, I won't be able to answer/solve the personal doubts of each and every student over here. For clearing your doubts, you can join our community on telegram - t.me/pepcoding.
Top-down is better if you need the final value only or need one specific output, but if you want to output multiple values then go for memoization as it stores the value for each element operation.
sir is it necessary to go upto last row, i mean if managed to find subset which gives target sum like in above qtn for second last row we achived the target sum, uske baad Break karke loop ke bahar aa sakten hain na sir ?
I don't think anyone teaches the problem this deeply and with so much clarity ! Thank you so much sir for providing these video solutions .
sir never write comment to any tutorial in youtube but today i am really impressed by your teaching method ,thank you so much
This cricket concept goes very well with DP. Awesome way to make us understand the solution. You are an amazing teacher!
Best content on DS and algo on the internet right now
Thankyou beta!
I am glad you liked it. I also hope that you are watching till end and trying to understand the what, how and especially why of the problem.
If you like our efforts, will you like to write a few words about us here (www.quora.com/How-do-I-start-learning-or-strengthen-my-knowledge-of-data-structures-and-algorithms )
Keep learning and keep loving Pepcoding😊
No other channel no other, nowhere can anyone find such top quality content
The level of understanding you have for these topics is amazing sir 🔥thanks you sir for providing this for free.
Next Level Explanation!!!!
This is the best video on TH-cam to understand this question:) NO DOUBT ❤👌🤌
Thank you very much Sir!!!😇🙏
I do good programming, but when it comes DP, recursion I got confused. I have started my DP, Recursion journey from so-called premium channels, but all went in vain...Now I find your explanation, I am satisfied and very happy because you explain how I wanted to learn from deep. Thank you very much.
Your understanding and expression of understanding(teaching) is great! Wish i could learn DP from you directly
solved about 500+ questions on dsa from watching tutors in utube only but for the first time i am hitting like button from my heart...this explanation is just next level dp ka dhaga dhaga khol diya apne thank u for such content sir
finally i understood this . you have some serious teaching skills . Thanks a lot for this video !!!!
you are the best teacher on youtube
for any problem, i first search on pepcoding. You are amazing Sir! Your concepts and way of teaching are more retained by me, as compared to teachings of other teachers on youtube.
Its 30 min video and you are describing the concept for 20 min and rest code :). Really Appreciate your work.
the depth in which you clears our concept is amazing and can write code by my own
Nados.pepcoding.com pe experience aur acha hai
Amazing lecture. Best explanation on TH-cam.
Sir you are a good singer along with coder 👍
I always used to run away from dp, thought it was hard, but after seeing your videos, I feel blessed. Thankyou Sir :)
Kya gadar example sir......Insane level explanation , pehli baar DP ki problems doable lgg rhi hain.... All thanks to you Sumeet Sir
Thank you so much!! pdtee rhiee or bdtee rhiee
@@Pepcoding Bss sir aap isi tarah bdiya examples k sth smjhate rhiye or hmara kalyan krte rhie :p
First time i understand that how this 2-d array works. Thank you sir..
I am glad you liked it. I hope that you are watching the videos till the end and trying to understand what, how, and especially why of the problem.
If you like our efforts, will you like to write a few words about us here (www.quora.com/How-do-I-start-learning-or-strengthen-my-knowledge-of-data-structures-and-algorithms )
I love watching your videos. You make the solution so simple and explain everything so clearly. Keep up the good work buddy!
Finally I understood How elements are inserted in the table... & The example of cricket made it easier for me.. Thanks sir...
Glad you love the explanation.
For better experience and well organised content sign up on nados.io and don't forget to follow us on Instagram instagram.com/pepcoding/
Couldn't find a better explanation. Thanks a lot.🤩
maine itna smjha iss concept ko lekin har baar upar se; lekin sir ne jaise hi test match ka example dia, 2 sec me is ques ka {how} smjh gya :)
2 hours se buss video dekhke smjhne ki koshish krra tha finally agya .
Doubt support chaie to nados.pepcoding.com se dekho same video ko
got clarity of what going in the matrix, Thank you sir
You are reallyyyyy Underrated Sir!!!!!!🙂
While you were filling in the table i found that if a column consists of true then all the cells of the columns below the specified one consists of true hence while filling in dp[r][c] we can make a check like if(c==tar and dp[r][c] == true) return "true"; which will reduce the complexity a little bit or significantly, {depending upon the test cases}
By the way, the session was so engaging.
Pure gold♥️, belated birthday wishes sir
Thanks a ton
aapke jaisa teacher banna chaunga sir agar kabhi teacher banu to🙏🙏🙏🙏🙏🙏
Thank you so much Sir..Apka khoob dhanyawaad. You are a great teacher Sir !!
underrated he channel pta ni kyu but ty sir mza agya
Sir, you are one the best and number one coding tutor in India. Your expertise & amazing talent in teaching is just another level.
Please keep making these videos as your way of doing deep analysis and approach is just next level which is unmatched by any tutor across India.
Aapka support aur blessings chahiye bas 🙏
Glad to know that you liked the content and thank you for appreciating.
The love and respect which I get from you people keep me highly motivated and the same I am able to forward It to you people through my videos.
So, keep motivating, keep learning and keep loving Pepcoding😊
Good Content , with due focus on traversal of the logic till the end . Keep doing gr8 work Sumeet
please bring one video of dfs and bfs cases in every data structure
I mean, really, itna sahi explaination mene aaj tk nhi dekha. Aap best ho.
Please aur bhi algos k videos bana do please.
Aap har variety k dp k problems ka video bana do yaar, dp achche se samajh aa jaayegi. It would be really helpful
Thank you for appreciating.
The love and respect which I get from you people keep me highly motivated and the same I am able to forward It to you people through my videos.
So, keep motivating, keep learning and keep loving Pepcoding😊
super-duper hit explanation sirrrr👌🙌🙌🙌
Glad you liked it!
Keep learning.
And for better experience, visit nados.io, where you will get well curated content and career opportunities.
Sir, i like your singing❤️❤️
Best explanation in the world
I am curious about whether the time complexity of above explained tabulation and the memoization approach using recursion would be same or not?
This is the best explanation of the tabular dp approach. ❤️
I am glad you liked it. I also hope that you are watching till end and trying to understand the what, how and especially why of the problem.
If you like our efforts, we request a review - g.page/Pepcoding/review?rc
Relating it to criclet and then explaining
Thanks a ton. For better experience and best organised content visit on nados.io. Also you can post your doubts on community tab on NADOS.
shandar content hain sir.. thanks Sumeet sir.
Best Explanation of tabular method to solve dp problems !!
Really best content!! Keep going sir!
I want to see memoization method also!
Thankyou beta!
I am glad you liked it. I hope that you are watching till the end and trying to understand what, how, and especially why of the problem.
keep watching and keep loving Pepcoding😊
O bhai, simply so awesome
awesome sir!!!! nice explanation got it clearly!!
Very good explanation!
For cricket analogy, you could have chosen a subset of 4,2,6,1,3 and then said that there are ppl on the team who score ONLY 4, ONLY 2, ... or ONLY 3. That way, when you say remaining team, it is easy to visualize that a person who ONLY scores 4 cannot score 1,2,3,5, etc. -- -- this is a similar approach to when you have coins of specific denominations.
Overall, you made it very easy to understand how we go to (items - 1), (sum - current elem value), etc row, col. for the include/exclude scenarios.
And props to your tremendous patience in explaining the filling of all 11 * 6 = 66 cells!
Thankyou beta
Cricket method is best for understanding ❤️❤️❤️
index = j - arr[i - 1];
if(index < 0) dp[i][j] = dp[i - 1][j]
else dp[i][j] = dp[i-1][j] || dp[i-1][index]
the last else case
mja aa gya sir ji♥
I think as the tick marks are getting forwarded for a column so at line 32 we can simply check at i instead of i-1. Btw Amazing Explanation!
Thank you sir for solving the complete table hence providing a detailed and understandable explanation. I wanted to ask whether it will be sufficient to provide this (tabulation) approach in a technical interview.
Yes, sure
sir iss problem ko recursion with dp se bhi solve kar skte hain
what a brilliant way of teaching !!!
Thank you for appreciating. keep motivating, keep learning and keep loving Pepcoding😊
in the same problem how to return 2d array with subsets of k?
Beautiful Explaination!
Initially I used the Two Pointer Algo. 4/5 test cases passed could have never thought of this approach but abb aaisa related question aaya toh apna cricketer SIX maarega!
best of luck. ye 5 questions ka set hai poora. Order me kijiega.
awesome vid!
how to modify this to count no of subsets or return the required subsets
Nice content.. which editor are you using?
This really means a lot, Thank you for your immense support and the most important thing you guys liked it. For much better content visit on nados.pepcoding.com, you can also post such query on community tab.
Don't forget to follow us on Instagram instagram.com/pepcoding/
Amazing explanation sir... i was very confused with the formula of it. and you made it very clear. Thank you so much!!!
Happy to help!
Keep learning.
And for better experience, visit nados.io, where you will get well curated content and career opportunities.
Sir for this question do we have any other approach also.
Sir if i do this question using arraylist why is is showing TLE
thank you so much sir! your explanation is superb 😍
Awsome Video!!!! Sir, ek doubt h.. meine jab isko solve karne k approach liya meine.. Dp ke rows mein Sum li..(0-10) aur columns mein (0-6) ..code bhi accordingly chnage kiya h...but answer ni aa rha..koi solution bhi ni mil rha Internet pe iska..Ye pata kaise chalega ki rows mein kisko lena h aur ol mein kisko lena h?
kisi ko hickhi aa rahi background me.. amazing work sir i had been struggling with this coin change and entire tabular form of dp ... i get the recursive dp very easily but the itravtive one i havent found anyone better than you so thank you sir ...
Iss video k Pehle to mein sir ki fan thi ab to puri air conditioner ban Gayi hu, XD XD !! amazing DP explanation.
Haha..that was really nice😋😂
I am glad you liked it. I hope that you are watching the videos till the end. If you like our efforts, will you like to write a review about us here - g.page/Pepcoding/review?rc
@@Pepcoding sure sir!
Dimag m chap gyi h algo.. hats off👏👏
Thankyou beta!
I am glad you liked it. I also hope that you are watching till the end and trying to understand the what, how, and especially why of the problem. If you like our efforts, will you like to review us here - g.page/Pepcoding/review?rc
wah sir wah !!!!
batting team run what a fantastic explanation i couldn't stop myself from putting comment.
DP, graph is toughest pls cover too many ques on these topics.
and yes pls do memoization (recursive approach) also.
from 500 subs to 5k subs i m seeing the transformation!!
Thank you. Bro, linkedin ya fb pe ek post daal do channel ki. Bacho ko pta chal jaega.
Will redo all DP in memoization as well. Par sath nahi, video bhot lambi ho jaegi.
@@Pepcoding Yes sir i m sharing ur channel in my clg grp.
great explanation sir ! thankyou for your valuable content
will also work if the array has repeating elemets
Great Explanation
Sir humko kaise pataa chalega ki humko gap method use krna hai ya nhi
beshak apne boht khoob pdhaya..pr abhi hme smj na aya..2 3 bar fir video dekhenge..uske bad kam bnega bhaya..🐍😅🙏
Nice explanation sir❣️
sir,can this approach also be used to print the subsets for the target sum rather than just printing true or false?
yes, that is an extended question. That will need graphs and DP.
can anyone share the bottom up approach of this question?
Very good singing 😇👏🏻
Thank you so much sir ,🙏🙏🙏🙏🙏🙏🙏🙏
Feedback : Sir i think agar cricket wala concept na lakar normal samjhate to jaldi
Samajh aata.
Cricket wale se little bit confusing lag raha tha.
Btw great Content sir Thank you so much ❤️
Sir i had one confusion that using this approach how can we print that subset. Will we be inserting it into the vector right when we get true in the starting...matlab ye h ki i am not able to locate that how we will do this.
Sir first question mei dp ka use ache se smjh aa gya tha kyuki apne ache se smjhaya tha k hme us question ko sove krne k liye dp kyo use krni chaiye. Sir vaisi he explanation( mtlb ye k dp regular approach se better kaise h) agr is question ki bhi mil jati to isme dp ka use ache se smjh ata. vaise ab video to bn chuki h , pr aap dp ka use pls ya to comment section mei bta dijiye ya discription mei.( Pta nhi km jo khna cha rha hu vo aap is comment se smjh payenge ya nhi)
Beta, I regret to inform you that, I won't be able to answer/solve the personal doubts of each and every student over here. For clearing your doubts, you can join our community on telegram - t.me/pepcoding.
Great Explanation Sir! Thank You..
It's literally appreciable.
Thanks alot Sir
It's my pleasure
The words made my day. I request you to write about our channel on your facebook or linkedin? So that maximum students could get the best out of it.
Best explanation sir, Thank you.
keep motivating, keep learning and keep loving Pepcoding😊
Amazing explanation with Analogy sir. 👌👌
Thankyou beta!
I am glad you liked it. I hope that you are watching till the end and trying to understand what, how, and especially why of the problem.
If you like our efforts, will you like to write a few words about us here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )
Sare question hm tabulation se karte h memorization ka use nahi karte kya sir??
For better experience and well organised content.
visit - nados.pepcoding.com
Also you can post your query on community tab.
Don't forget to follow us on Instagram instagram.com/pepcoding/
Beautifully explained. Thanks a lot.
Most welcome!
sir apke notes me likha hai """for negative numbers , make dp where columns range from -target to target """"
yeah samaj nhi aarha , negative numbers ko kaise handle kre ....
sir mene khud se dry run kia h to yeah result nikla hai ki array me agar negative values hai then,...
array ki max value jitne columns banege ( + - dono me) . ex arr is 4 , 3 , -2 , 5 and target is 3 then columns will be -5 to 5 ...
is it right sir ? correct me if not.. sumeet sir
@pepcoding
Sir ek request, after I watched first 2 DP videos, I was able to do next 2-3 questions on my own, but then this came so I was afraid that why this approach didnt strike, should I be afraid, I keep thinking that do other good students figure it on their own or watch solution video and this makes me anxious towards learning and creates self doubt, It would be great if you tell in the video that this question was difficult without a hint, I mean please in a line tell that this question I didnt expect you to do if you havent done before.. Being a coder I guess you must be able to understand this anxiety.
Thankyou Sir.
Beta abhi aap jab tak 100-200 dp k questions khud se na kar lo tab tak it will be too soon to expect from yourself ki aap har question khud se attemp kr pao. To abhi har question par time spend kro zda se zda aur jab lge ki ab zda dimaag nh chal rh to tab jaa k solution dekh lo.
Aise krne se kya hoga ki dheere dheere apki thinking capability bdegi aur jb itne question kr loge to fr aap jab koi nya question uthaoge to ye figure kr paoge ki ye question kis strategy se hoga ya kis trh ki dp bnani pdegi isme.
@@Pepcoding Thankyou sir for the guidance I will take care 🙏🔥
Bhot hi zabardast samjhaya sir aapne!!
Thankyou beta!
I am glad you liked it. If you like our efforts, will you like to write a few words about us here (www.quora.com/How-do-I-start-learning-or-strengthen-my-knowledge-of-data-structures-and-algorithms )
Thankyou Sir, it was a great analogy.
Beautiful explanation...thanks a lot sir
What if the target sum is big say 100 or 1000.. do we create that many columns??
Yes, we will need more columns. We can optimise the rows. Actually we can do it with just 2 one d arrays.
What if there are negative elements?
really greatt and thank u sirrrr
sir why did we take the first cross row, what was its use??
kyunki dp ki table bharte hue upar wali row mei jana padta hai. extra case handle karne se bachne ke liye.
sir, superb way of explanation
I am glad you liked it. I also hope that you are watching till end and trying to understand the what, how and especially why of the problem.
If you like our efforts, we request a review
g.page/Pepcoding/review?rc
You can subscribe to our channel here
th-cam.com/users/Pepcodingabout?view_as=subscriber
@@Pepcoding donee
Sumeet - I love you. You are the BEST
Thank you Bhai
very well explained...But I am wondering whether this is possible only when target is small enough. How about if the numbers in the array are like [200,300,45,487,454] and target is 500. Filling 500 column table can be more time complex r8?
Thankyou!
Buddy, I regret to inform you that, I won't be able to answer/solve the personal doubts of each and every student over here. For clearing your doubts, you can join our community on telegram - t.me/pepcoding.
Yo Laxman , did you find an answer for the question you asked ??
Amazing teacher 🙏🏿
Keep learning, Keep growing and keep loving Pepcoding!😊
Sir which approach is better for solving Recursion(Memoization) or Top down.
Top-down is better if you need the final value only or need one specific output, but if you want to output multiple values then go for memoization as it stores the value for each element operation.
Sir can we solve this by memoization method?
Yes.
sir is it necessary to go upto last row, i mean if managed to find subset which gives target sum like in above qtn for second last row we achived the target sum, uske baad Break karke loop ke bahar aa sakten hain na sir ?
aa sakte hain beta.