Target Sum Subsets Dynamic Programming | Subset Sum Problem

  Рет қаралды 93,522

Pepcoding

Pepcoding

Күн бұрын

Please consume this content on nados.pepcoding.com for a richer experience. It is necessary to solve the questions while watching videos, nados.pepcoding.com enables that.
NADOS also enables doubt support, career opportunities and contests besides free of charge content for learning. In this video, we discuss the solution where we are required to find the subset of an array with sum equal to a given target. In this problem
1. You are given a number n, representing the count of elements.
2. You are given n numbers.
3. You are given a number "tar".
4. You are required to calculate and print true or false, if there is a subset the elements of which add up to "tar" or not.
For a better understanding of the problem, click here: • Target Sum Subsets - Q...
For a better experience and more exercises, VISIT: www.pepcoding....
#dp #targetsum #dynamicprogramming
Have a look at our result: www.pepcoding....
Follow us on our FB page: / pepcoding
Follow us on Instagram: / pepcoding
Follow us on LinkedIn: / pepcoding-education

Пікірлер: 254
@shreyasingh7833
@shreyasingh7833 3 жыл бұрын
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 .
@puccaepisodes1509
@puccaepisodes1509 3 жыл бұрын
This cricket concept goes very well with DP. Awesome way to make us understand the solution. You are an amazing teacher!
@KhairulMia-tr2jv
@KhairulMia-tr2jv Жыл бұрын
sir never write comment to any tutorial in youtube but today i am really impressed by your teaching method ,thank you so much
@murtuzashareef7906
@murtuzashareef7906 Жыл бұрын
No other channel no other, nowhere can anyone find such top quality content
@umaradhami
@umaradhami 3 жыл бұрын
Best content on DS and algo on the internet right now
@Pepcoding
@Pepcoding 3 жыл бұрын
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😊
@vsbelieve
@vsbelieve 2 жыл бұрын
The level of understanding you have for these topics is amazing sir 🔥thanks you sir for providing this for free.
@pijushbasak4273
@pijushbasak4273 3 жыл бұрын
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.
@watchforabhay
@watchforabhay 2 жыл бұрын
Your understanding and expression of understanding(teaching) is great! Wish i could learn DP from you directly
@starmist808
@starmist808 2 жыл бұрын
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.
@MayankkumarKaushik-ze5bx
@MayankkumarKaushik-ze5bx 2 ай бұрын
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
@codewithrebel1286
@codewithrebel1286 3 жыл бұрын
First time i understand that how this 2-d array works. Thank you sir..
@Pepcoding
@Pepcoding 3 жыл бұрын
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 )
@sumitmishra848
@sumitmishra848 3 жыл бұрын
finally i understood this . you have some serious teaching skills . Thanks a lot for this video !!!!
@closer9689
@closer9689 5 ай бұрын
Next Level Explanation!!!! This is the best video on KZbin to understand this question:) NO DOUBT ❤👌🤌 Thank you very much Sir!!!😇🙏
@pritishpattnaik4674
@pritishpattnaik4674 2 жыл бұрын
the depth in which you clears our concept is amazing and can write code by my own
@Pepcoding
@Pepcoding 2 жыл бұрын
Nados.pepcoding.com pe experience aur acha hai
@shubhambhardwaj2399
@shubhambhardwaj2399 3 жыл бұрын
Sir you are a good singer along with coder 👍
@mihiradarsh7604
@mihiradarsh7604 3 жыл бұрын
I always used to run away from dp, thought it was hard, but after seeing your videos, I feel blessed. Thankyou Sir :)
@shwetajha5356
@shwetajha5356 2 жыл бұрын
Finally I understood How elements are inserted in the table... & The example of cricket made it easier for me.. Thanks sir...
@Pepcoding
@Pepcoding 2 жыл бұрын
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/
@suzanaangboo2448
@suzanaangboo2448 Жыл бұрын
Its 30 min video and you are describing the concept for 20 min and rest code :). Really Appreciate your work.
@ayushsaxena9386
@ayushsaxena9386 Жыл бұрын
you are the best teacher on youtube
@shivangsharma4873
@shivangsharma4873 4 жыл бұрын
Kya gadar example sir......Insane level explanation , pehli baar DP ki problems doable lgg rhi hain.... All thanks to you Sumeet Sir
@Pepcoding
@Pepcoding 4 жыл бұрын
Thank you so much!! pdtee rhiee or bdtee rhiee
@shivangsharma4873
@shivangsharma4873 4 жыл бұрын
@@Pepcoding Bss sir aap isi tarah bdiya examples k sth smjhate rhiye or hmara kalyan krte rhie :p
@maniac0224
@maniac0224 6 ай бұрын
Amazing lecture. Best explanation on KZbin.
@aditikhare1784
@aditikhare1784 2 жыл бұрын
I love watching your videos. You make the solution so simple and explain everything so clearly. Keep up the good work buddy!
@sanyamkothari4469
@sanyamkothari4469 2 жыл бұрын
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 :)
@pranayreddyannam188
@pranayreddyannam188 2 жыл бұрын
got clarity of what going in the matrix, Thank you sir
@snehalkumar.singh.cse2070
@snehalkumar.singh.cse2070 2 жыл бұрын
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.
@therohanjaiswal
@therohanjaiswal 2 жыл бұрын
Couldn't find a better explanation. Thanks a lot.🤩
@kaushalsharma9777
@kaushalsharma9777 4 жыл бұрын
Pure gold♥️, belated birthday wishes sir
@Pepcoding
@Pepcoding 4 жыл бұрын
Thanks a ton
@0anant0
@0anant0 3 жыл бұрын
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!
@Pepcoding
@Pepcoding 3 жыл бұрын
Thankyou beta
@amazinglife5400
@amazinglife5400 3 жыл бұрын
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 🙏
@Pepcoding
@Pepcoding 3 жыл бұрын
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😊
@sudhanshusharma9123
@sudhanshusharma9123 3 жыл бұрын
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.
@Pepcoding
@Pepcoding 3 жыл бұрын
Yes, sure
@MegaArvind111
@MegaArvind111 3 жыл бұрын
Good Content , with due focus on traversal of the logic till the end . Keep doing gr8 work Sumeet
@shreyanshsharma8909
@shreyanshsharma8909 3 жыл бұрын
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
@Pepcoding
@Pepcoding 3 жыл бұрын
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😊
@MahimDashoraHackR
@MahimDashoraHackR 2 жыл бұрын
2 hours se buss video dekhke smjhne ki koshish krra tha finally agya .
@Pepcoding
@Pepcoding 2 жыл бұрын
Doubt support chaie to nados.pepcoding.com se dekho same video ko
@prasads7530
@prasads7530 2 жыл бұрын
Thank you so much Sir..Apka khoob dhanyawaad. You are a great teacher Sir !!
@akrammohammed1167
@akrammohammed1167 3 жыл бұрын
This is the best explanation of the tabular dp approach. ❤️
@Pepcoding
@Pepcoding 3 жыл бұрын
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
@vedantvalsangkar2091
@vedantvalsangkar2091 3 жыл бұрын
Best Explanation of tabular method to solve dp problems !! Really best content!! Keep going sir! I want to see memoization method also!
@Pepcoding
@Pepcoding 3 жыл бұрын
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😊
@AYJ959
@AYJ959 Жыл бұрын
underrated he channel pta ni kyu but ty sir mza agya
@rohitbadhai8219
@rohitbadhai8219 2 жыл бұрын
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!
@jenishchetankumarpatel1662
@jenishchetankumarpatel1662 Жыл бұрын
please bring one video of dfs and bfs cases in every data structure
@closer9689
@closer9689 5 ай бұрын
You are reallyyyyy Underrated Sir!!!!!!🙂
@cr7johnChan
@cr7johnChan 2 жыл бұрын
Best explanation in the world
@himanshuhota01
@himanshuhota01 2 жыл бұрын
aapke jaisa teacher banna chaunga sir agar kabhi teacher banu to🙏🙏🙏🙏🙏🙏
@mayursuhasiya8613
@mayursuhasiya8613 2 жыл бұрын
Amazing explanation sir... i was very confused with the formula of it. and you made it very clear. Thank you so much!!!
@Pepcoding
@Pepcoding 2 жыл бұрын
Happy to help! Keep learning. And for better experience, visit nados.io, where you will get well curated content and career opportunities.
@24381498
@24381498 3 жыл бұрын
shandar content hain sir.. thanks Sumeet sir.
@sagarbanga8188
@sagarbanga8188 3 жыл бұрын
what a brilliant way of teaching !!!
@Pepcoding
@Pepcoding 3 жыл бұрын
Thank you for appreciating. keep motivating, keep learning and keep loving Pepcoding😊
@shubhammittal4389
@shubhammittal4389 2 жыл бұрын
Relating it to criclet and then explaining
@Pepcoding
@Pepcoding 2 жыл бұрын
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.
@ashutosh1541
@ashutosh1541 4 жыл бұрын
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 ...
@RahulKumar-pk7ht
@RahulKumar-pk7ht Жыл бұрын
Sir, i like your singing❤️❤️
@0_0-0_0.
@0_0-0_0. 3 жыл бұрын
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 ❤️
@rajeshdas2295
@rajeshdas2295 Жыл бұрын
awesome sir!!!! nice explanation got it clearly!!
@harshitgupta5887
@harshitgupta5887 Жыл бұрын
I am curious about whether the time complexity of above explained tabulation and the memoization approach using recursion would be same or not?
@vipsclassicalboy
@vipsclassicalboy 2 жыл бұрын
O bhai, simply so awesome
@coderguy339
@coderguy339 4 жыл бұрын
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!!
@Pepcoding
@Pepcoding 4 жыл бұрын
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.
@coderguy339
@coderguy339 4 жыл бұрын
@@Pepcoding Yes sir i m sharing ur channel in my clg grp.
@saraswansinha1132
@saraswansinha1132 3 жыл бұрын
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?
@ditu-kunalsarda6863
@ditu-kunalsarda6863 4 жыл бұрын
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!
@Pepcoding
@Pepcoding 4 жыл бұрын
best of luck. ye 5 questions ka set hai poora. Order me kijiega.
@kushagra4401
@kushagra4401 3 жыл бұрын
thank you so much sir! your explanation is superb 😍
@kms8320
@kms8320 2 жыл бұрын
super-duper hit explanation sirrrr👌🙌🙌🙌
@Pepcoding
@Pepcoding 2 жыл бұрын
Glad you liked it! Keep learning. And for better experience, visit nados.io, where you will get well curated content and career opportunities.
@aayushsharma5156
@aayushsharma5156 3 жыл бұрын
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)
@Pepcoding
@Pepcoding 3 жыл бұрын
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.
@abhishek__anand__
@abhishek__anand__ Жыл бұрын
Great Explanation
@namanshah2688
@namanshah2688 2 жыл бұрын
great explanation sir ! thankyou for your valuable content
@vihaansingla5088
@vihaansingla5088 3 жыл бұрын
sir iss problem ko recursion with dp se bhi solve kar skte hain
@rakshitdevra7060
@rakshitdevra7060 2 жыл бұрын
Cricket method is best for understanding ❤️❤️❤️
@Tarunkumar-si4im
@Tarunkumar-si4im 3 жыл бұрын
Nice explanation sir❣️
@eshanikabhattacharjee383
@eshanikabhattacharjee383 3 жыл бұрын
awesome vid! how to modify this to count no of subsets or return the required subsets
@Kuldeep-rn9ts
@Kuldeep-rn9ts 3 жыл бұрын
Best explanation sir, Thank you.
@Pepcoding
@Pepcoding 3 жыл бұрын
keep motivating, keep learning and keep loving Pepcoding😊
@akhilesh59
@akhilesh59 3 жыл бұрын
Great Explanation Sir! Thank You..
@AKASHKUMAR-li7li
@AKASHKUMAR-li7li 3 ай бұрын
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♥
@damaanilkumar391
@damaanilkumar391 2 жыл бұрын
fab teaching
@kushagra_kesav
@kushagra_kesav 4 жыл бұрын
It's literally appreciable. Thanks alot Sir
@Pepcoding
@Pepcoding 4 жыл бұрын
It's my pleasure
@Pepcoding
@Pepcoding 4 жыл бұрын
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.
@anshulgarg6146
@anshulgarg6146 3 жыл бұрын
Bhot hi zabardast samjhaya sir aapne!!
@Pepcoding
@Pepcoding 3 жыл бұрын
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 )
@ananyaarya2465
@ananyaarya2465 3 жыл бұрын
Iss video k Pehle to mein sir ki fan thi ab to puri air conditioner ban Gayi hu, XD XD !! amazing DP explanation.
@Pepcoding
@Pepcoding 3 жыл бұрын
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
@ananyaarya2465
@ananyaarya2465 3 жыл бұрын
@@Pepcoding sure sir!
@prahladrana6391
@prahladrana6391 4 жыл бұрын
sir,can this approach also be used to print the subsets for the target sum rather than just printing true or false?
@Pepcoding
@Pepcoding 4 жыл бұрын
yes, that is an extended question. That will need graphs and DP.
@jatinmaheriya2343
@jatinmaheriya2343 3 жыл бұрын
Very good singing 😇👏🏻
@arnabmallik7978
@arnabmallik7978 4 жыл бұрын
Beautifully explained. Thanks a lot.
@Pepcoding
@Pepcoding 4 жыл бұрын
Most welcome!
@himanshuhota01
@himanshuhota01 2 жыл бұрын
Thank you so much sir ,🙏🙏🙏🙏🙏🙏🙏🙏
@sunnygoswami2248
@sunnygoswami2248 3 жыл бұрын
Thankyou Sir, it was a great analogy.
@sahilgupta9378
@sahilgupta9378 3 жыл бұрын
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.
@Pepcoding
@Pepcoding 3 жыл бұрын
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.
@sahilgupta9378
@sahilgupta9378 3 жыл бұрын
@@Pepcoding Thankyou sir for the guidance I will take care 🙏🔥
@jenishchetankumarpatel1662
@jenishchetankumarpatel1662 Жыл бұрын
really greatt and thank u sirrrr
@ghanendrapanwar165
@ghanendrapanwar165 2 жыл бұрын
Sir for this question do we have any other approach also.
@samarthsingh663
@samarthsingh663 3 жыл бұрын
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.
@saarthjhaveri8716
@saarthjhaveri8716 3 жыл бұрын
sir, superb way of explanation
@Pepcoding
@Pepcoding 3 жыл бұрын
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 kzbin.infoabout?view_as=subscriber
@saarthjhaveri8716
@saarthjhaveri8716 3 жыл бұрын
@@Pepcoding donee
@rishabhgoyal2835
@rishabhgoyal2835 4 жыл бұрын
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
@aashishgoyal1436
@aashishgoyal1436 4 жыл бұрын
Beautiful explanation...thanks a lot sir What if the target sum is big say 100 or 1000.. do we create that many columns??
@Pepcoding
@Pepcoding 4 жыл бұрын
Yes, we will need more columns. We can optimise the rows. Actually we can do it with just 2 one d arrays.
@RishabhJain-hr6sz
@RishabhJain-hr6sz 3 жыл бұрын
Amazing explanation with Analogy sir. 👌👌
@Pepcoding
@Pepcoding 3 жыл бұрын
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 )
@southern-sunshine
@southern-sunshine 3 жыл бұрын
Sumeet - I love you. You are the BEST
@Pepcoding
@Pepcoding 3 жыл бұрын
Thank you Bhai
@sarangr8624
@sarangr8624 3 жыл бұрын
Amazing teacher 🙏🏿
@Pepcoding
@Pepcoding 3 жыл бұрын
Keep learning, Keep growing and keep loving Pepcoding!😊
@shivanikapoor9305
@shivanikapoor9305 2 жыл бұрын
Nice content.. which editor are you using?
@Pepcoding
@Pepcoding 2 жыл бұрын
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/
@sagar1287
@sagar1287 3 жыл бұрын
Sir maje aa gaye question solve karne me 🏏🤩
@Pepcoding
@Pepcoding 3 жыл бұрын
Glad to know that you liked the content and thank you for appreciating. 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 motivating, keep learning and keep loving Pepcoding😊
@chintu225
@chintu225 3 жыл бұрын
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?
@Pepcoding
@Pepcoding 3 жыл бұрын
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.
@elroinoronha433
@elroinoronha433 3 жыл бұрын
Yo Laxman , did you find an answer for the question you asked ??
@dark_techyy
@dark_techyy 3 жыл бұрын
beshak apne boht khoob pdhaya..pr abhi hme smj na aya..2 3 bar fir video dekhenge..uske bad kam bnega bhaya..🐍😅🙏
@Travellingwithaayu
@Travellingwithaayu 3 жыл бұрын
Dimag m chap gyi h algo.. hats off👏👏
@Pepcoding
@Pepcoding 3 жыл бұрын
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
@anubhavkalia5130
@anubhavkalia5130 3 жыл бұрын
Very nice Explanation
@Pepcoding
@Pepcoding 3 жыл бұрын
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. 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 )
@amberchawla7930
@amberchawla7930 3 жыл бұрын
I think this bottom up approach , you have not shown why there was redundancy. Though anyone who would have been watching your series from starting would have understood
@pranavsingh1081
@pranavsingh1081 2 жыл бұрын
sir mza aa gyi
@ayushsaxena9386
@ayushsaxena9386 Жыл бұрын
in the same problem how to return 2d array with subsets of k?
@gauravnarang955
@gauravnarang955 4 жыл бұрын
just a suggestion it will be better if you start the solution first by providing a recursive solution instead of directly jumping to creating 2D array
@Pepcoding
@Pepcoding 4 жыл бұрын
I am goign to redo whole dp via recursion (memoization). I will do tabulation and memoization in separate videos to keep the length of video tolerable.
@pinakeekaushik7803
@pinakeekaushik7803 4 жыл бұрын
@@Pepcoding yes sir please do it that way . Thanks a ton, a very very happy belated birthday sir
@mayankverma8520
@mayankverma8520 3 жыл бұрын
@@Pepcoding sir memoization vali playlist dedijiye!!!!please
@ayushsaxena9386
@ayushsaxena9386 Жыл бұрын
thanks sir.
@AnkitSharma-wj2tb
@AnkitSharma-wj2tb 3 жыл бұрын
great explanation again sir
@Pepcoding
@Pepcoding 3 жыл бұрын
Thanks and welcome
@nostakash
@nostakash 3 жыл бұрын
Sir humko kaise pataa chalega ki humko gap method use krna hai ya nhi
@harshpratapsingh3736
@harshpratapsingh3736 3 жыл бұрын
will also work if the array has repeating elemets
Epic Reflex Game vs MrBeast Crew 🙈😱
00:32
Celine Dept
Рет қаралды 18 МЛН
Help Me Celebrate! 😍🙏
00:35
Alan Chikin Chow
Рет қаралды 76 МЛН
Good teacher wows kids with practical examples #shorts
00:32
I migliori trucchetti di Fabiosa
Рет қаралды 11 МЛН
Subset Sum Problem using Dynamic Programming | Data Structures and Algorithms
25:03
Minimum subset sum difference interviewbit
22:30
Code with Alisha
Рет қаралды 5 М.
Count subsets with given sum | Dynamic Programming
17:25
Techdose
Рет қаралды 41 М.
L10. Subset Sum I | Recursion | C++ | Java
24:25
take U forward
Рет қаралды 362 М.
Subset Sum Problem Dynamic Programming
9:07
Tushar Roy - Coding Made Simple
Рет қаралды 532 М.
Epic Reflex Game vs MrBeast Crew 🙈😱
00:32
Celine Dept
Рет қаралды 18 МЛН