My words will fall short to appreciate your efforts, every time i watch your tutorials you always take my heart :) hope can meet u one day to thank you for your wonderful work. God bless /\ :)
no one can teach better than you , Sir please keep teaching forever. If you are teaching any paid course then also we are ready to pay for the best teacher in the world
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😊
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 )
Woooooow! Tysm sir for your loads of efforts to make this problem simple to understand. Have been following you for 2 months and I am glad I found this channel. GRATITUDE _/\_ :-D
Thanks a ton and If you like our efforts, please upvote the comments written by the students about Pepcoding here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )
I have got this question in an interview but I had to print the correct sentence. I was able to do it but they also told to prioritize between "man" "go" to "mango" instead. Any idea how Should I have done this priority thing?
how to come up with assigning meaning. Thats the main problem with me. I don't understand how to assign meaning untill you explain.But in Interviews how will I find the assigning meaning to the dp array
Due to awesome and detailed explanation, you added one subscriber. Also can you please explain why this test cased failed. Input: s = "catsandog", wordDict = ["cats","dog","sand","and","cat"] Output: false
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.
you are doing great man .. u can make the option also to join the group with subscribed also .. I will share ur course with the college .... it is the best course and frankly speaking this course very useful even for a person like me I have more than 13yr exp in big data but I really like ur video .. will try my best to make available for all the engineer.
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
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 )
thank you so much. ajkal to bache motivate bhi nahi karte. jo karte hain unke hum tahe dil se dhukargujaar hain. aapki support se he content bnane mei bhot madad milti hai
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
first if u are trying in C++ , change substr end value as i-j+1. Then, change dp as bool vector to avoid overflow. and finally take bitwise or of dp[i] and dp[j-1] for if case.
@@chickusingh6166 from this concept i code it in c++ on leetcode but my this test case is failed ... "catsandog", wordDict = ["cats","dog","sand","and","cat"] and my code is class Solution { public: bool wordBreak(string s, vector& wordDict) {
first if u are trying in C++ , change substr end value as i-j+1. Then, change dp as bool vector to avoid overflow. and finally take bitwise or of dp[i] and dp[j-1] for if case.
Beta, mai jab bna rha tha to pepcoding financially struggle kar rahi thi. aur mai bhi kamm bna pata tha tension mei. Ab content jyada banta hai per day, aur pepcoding bhi financially safe jyada hai kyunki mai doosri taraf kaam karta hun. khair, mai bhi content bnaunga. web dev hindi mei aur DS english mei.
Glad it helped! and If you like our efforts, please upvote the comments written by the students about Pepcoding here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )
sir ji ye solution un cases ke lie fail karaga jab hmare pas single letter ke word bad mei honge for eg words dictionary=["iajxlo" , "h" , "q"] and senetence is hhqhq iska output true ana chaye lakin is logic se false ara hai sir. kase improve hoga sir ye.
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.
This will give a runtime error on leetcode because of integer overflow. A workaround is possible as i did below: //dp[i] -- if string s(0...i) can be segmented or not. // dp[n-1] is the answer; //dp[i] = dp[j-1] if s(j...i) present in dictionary. If j-1
Sir mujse recursion ke question nhi horhe and koi bhi question khudh se nhi ho rha recursion ka aapke free resources se, sir kuch improvement ke liye batao please
level2 mein graphs and trees karwa dijiega next topics uske baad chote chote topics jaise greedy,array,divide and conquer,LL,SandQ aap dhere dhere kara dijiega no prblem, but graphs and Trees ache se karwa dijiye
For more videos like this, stay tuned and keep watching. And for better experience and precisely arranged content visit on nados.pepcoding.com Don't forget to follow us on Instagram instagram.com/pepcoding
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😊
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
My words will fall short to appreciate your efforts, every time i watch your tutorials you always take my heart :) hope can meet u one day to thank you for your wonderful work. God bless /\ :)
Thank You So Much Sumeet Sir.............🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻 respect++
no one can teach better than you , Sir please keep teaching forever. If you are teaching any paid course then also we are ready to pay for the best teacher in the world
Sir, Dynamic Programming could not be made more easier. You are a G.O.A.T.
dekhne me 5 line ka code..... usko acha se samjhane ke liye more than 50 videos.
Thank you so much bhaiya apke ye sab content upload karne ke lliye.
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😊
Sir , never ever I saw such a deep explaination of a question on youtube. Thx a lot for this effort sir.
You are a gem. I cannot in words express how great and honest your efforts are to.
Pranam🙏🙏🙏🙏
for single character it fails, tc: s="a" and set=["a"], use j
True hard work and sheer dedication! You are the best!
Firr yar thode views dilwao
@@Pepcoding Will suggest my friends!
Damn, sir. This tutorial is really really good! The dry runs really make the entire thing so much easier
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 )
Can't find a better explaination. This is the best it gets!
sir, you are awesome I had lots of problems in dp. After watching your playlist of dp now I feel comfortable in dp.
Aap padhate ho to ek baar me samajh aa jaati hai cheeze.. thank you sir❤️
why the substring function does not take the ith character 23:44 please explain ?
6:30 is the timeStamo from where you will get hinge. Thank you @SumeetSir
Woooooow! Tysm sir for your loads of efforts to make this problem simple to understand. Have been following you for 2 months and I am glad I found this channel. GRATITUDE
_/\_
:-D
Best explanation Sir. Kudos to your efforts.
Thanks a Lot Sir!!
Your efforts to explain tough examples and dry run are commendable.
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 love the way you teach and appreciate your hard work
Thanks a ton and If you like our efforts, please upvote the comments written by the students about Pepcoding here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )
Sir 20k completed bahut jaldi 100k honge aap tension nahi lene ka🙏🙏❤️🔥🎉🎂
Aapka sath bna rahega to jaroor hoga
Can you please create a video for "Find median from data stream"!
Where can I find word wrap problem solution?
Fabulous Explanation sir!! This is how a problem should be approached.
Thanks a lot and yes you are right
very good explanation and very concise solution of such a tough problem
Oh! come on Guys!! no comments on his hair-style.. Seriously?? I mean just look at it .. dosen't it look badass😁
I have got this question in an interview but I had to print the correct sentence. I was able to do it but they also told to prioritize between "man" "go" to "mango" instead. Any idea how Should I have done this priority thing?
could you explain how to approach its recursive solution?
how to come up with assigning meaning. Thats the main problem with me. I don't understand how to assign meaning untill you explain.But in Interviews how will I find the assigning meaning to the dp array
It is a problem with maths, permutations and combinations.
sir i think if you will have "ding" word in your dictionary then this process might fail
Due to awesome and detailed explanation, you added one subscriber. Also can you please explain why this test cased failed.
Input: s = "catsandog", wordDict = ["cats","dog","sand","and","cat"]
Output: false
sir aise roz ke 2-3 videos daalte rahiye,sir in problems se momentum bna rehta hai
Ok beta
Thank you so much sir for providing such content for free.
There is much more content on nados.pepcoding.com
Do check out
Time Complexity for this will be O(N^3) right?
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.
@@Pepcoding lol, answering yes or no would have taken less time than that
@@swastiksingh8452 😂😂true
thanks sir for this explanation code aceepted ☺☺
you are doing great man .. u can make the option also to join the group with subscribed also .. I will share ur course with the college .... it is the best course and frankly speaking this course very useful even for a person like me I have more than 13yr exp in big data but I really like ur video .. will try my best to make available for all the engineer.
nice sir ji🙌
Sir your explanation is great..but before explaining dp Sol plz also tell that how did you come up with intution of using 1D or 2D dp
Ok beta
Sir ye hairstyle mei ek no. lgte h ....Captain Cool.
Very Nice Explanation......Keep making videos
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
ye baat abhi nhi smaj ayegi but thoda aage chlkar smaj aane layegi...truely make sense..thnks
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 )
Sir its been almost a week since last level2 video, I hope everything is fine and it is just a temporary break, we are eagery waiting for level2 sir
Hanji beta, thora company main kch issues chl rh h vo resolve krne main lga hu. Jaldi he resume kruga content
Sir osm videos , all videos are super cool and i also recommend to my friends to watch your videos.
thank you so much. ajkal to bache motivate bhi nahi karte. jo karte hain unke hum tahe dil se dhukargujaar hain. aapki support se he content bnane mei bhot madad milti hai
I understand all of your video.
Can you please make video on word wrap
Hanji beta, ek bari jo agenda main questions h vo complete kr le, then ye sb cheeze bhi cover kr lenge
@@Pepcoding thankyou sir
sir aise baalo pe placement mil jati h kya??
Sir aapka ek month se koi video nahi aaya... Seriously missing your teaching... I hope everything is fyn sir... Please resume soon.
Beta, soon we are going to resume, feeling very strong about 10th jan.
Sir plz also cover TEXT JUSTIFICATION problem. It is also a hard dp interview question.
Hanji next wahi kraunga
Thanks a lot to your contribution to cs society....great job by popcoding
Very good explaination sirji ..keep making more videos of dp
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
happy teacher's day sir
Sir, This solution is giving runtime error(value of dp[s.length()-1] is very large) for leetcode 139. word break problem.
first if u are trying in C++ , change substr end value as i-j+1. Then, change dp as bool vector to avoid overflow. and finally take bitwise or of dp[i] and dp[j-1] for if case.
@@chickusingh6166 from this concept i code it in c++ on leetcode but my this test case is failed ...
"catsandog", wordDict = ["cats","dog","sand","and","cat"]
and my code is
class Solution {
public:
bool wordBreak(string s, vector& wordDict) {
vectordp(s.size(),false);
setst(wordDict.begin(),wordDict.end());
for (int i=0;i
this solution in leetcode(139) gives Runtime error for some testcase. Can anyone figure out this??
because of integer overflow.
first if u are trying in C++ , change substr end value as i-j+1. Then, change dp as bool vector to avoid overflow. and finally take bitwise or of dp[i] and dp[j-1] for if case.
sir rectangle painting probelem please se discuss kardijiye
Sir aapne dp and hashmaps ke baad konsa topic plan kia hai level2 mein?
Trees
@@Pepcoding Best hai sir, jaldi se jaldi kara dijiye
Sir plz make videos we are waiting for you your explanation is tooo good. Please continue sir
Beta, mai jab bna rha tha to pepcoding financially struggle kar rahi thi. aur mai bhi kamm bna pata tha tension mei. Ab content jyada banta hai per day, aur pepcoding bhi financially safe jyada hai kyunki mai doosri taraf kaam karta hun.
khair, mai bhi content bnaunga. web dev hindi mei aur DS english mei.
Gajab Hairstyle
Nice explanation sir.
Please upload a video for rat in a maze (movement possible in all directions) and m colouring graph problem.
Beta rat in maze flood fill naam se recursion mei hai aur graphs mei print all paths naam se
@@Pepcoding ok sir I will learn from there. Thank you.
understanding made very simple!!!.
Glad it helped! and If you like our efforts, please upvote the comments written by the students about Pepcoding here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )
For this solution TC will be O(N^2) and SC would be O(N). Right?
TC will be O(N^3) I think u left the complexity of substr stl. Sc is true. I am infering it based on C++.
@@chickusingh6166 Thank you!
@@chickusingh6166 can you send me the c++ code.
sir ji ye solution un cases ke lie fail karaga jab hmare pas single letter ke word bad mei honge
for eg words dictionary=["iajxlo" , "h" , "q"] and senetence is hhqhq iska output true ana chaye lakin is logic se false ara hai sir. kase improve hoga sir ye.
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.
replace i+1 with i-j+1
@@username-tg7if I was stuck here. Thank you so much.
@@shreyasaxena5169 most welcome
This will give a runtime error on leetcode because of integer overflow. A workaround is possible as i did below:
//dp[i] -- if string s(0...i) can be segmented or not.
// dp[n-1] is the answer;
//dp[i] = dp[j-1] if s(j...i) present in dictionary. If j-1
can you tell me why this !dp[i] part?
Sir mujse recursion ke question nhi horhe and koi bhi question khudh se nhi ho rha recursion ka aapke free resources se, sir kuch improvement ke liye batao please
Beta, time lagega. Doosri revision mein ho jaenge
@@Pepcoding okay thank you sir
Can we use this method and also print those 8 different strings ?
pepcoding loves mango icecream
student loves sumeet sirs hair cream
well explained sir👍
After code you should have done dry run correct way
For better experience visit on nados.pepcoding.com
Sir Possible ho toh Ap Apna daily routine schedule share krna
bhai, roj badalta hai
sir web dev ki nayi video kab ayegi?aur robotjs install nahi ho raha hai npm uska bhi solution
Beta abhi new script likh rha hun
Poori hone wali hai
❤❤
What is the time complexity of this solution?
great explanation Sir webdev ki videos bhi upload kar djiye. please .
Ji beta
Thank you Sir !
Thank you sir
All the best
level2 mein graphs and trees karwa dijiega next topics uske baad chote chote topics jaise greedy,array,divide and conquer,LL,SandQ aap dhere dhere kara dijiega no prblem, but graphs and Trees ache se karwa dijiye
Ji beta, koshish yhe kr rh hu
@@Pepcoding Ok thank you sir
sir dp ki bachi hui videos level 2 ki dal dijiye
Hanji beta, bna rh hu, under process h
awesome
For more videos like this, stay tuned and keep watching. And for better experience and precisely arranged content visit on nados.pepcoding.com
Don't forget to follow us on Instagram instagram.com/pepcoding
love the way you teach sirji
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😊
Sr lagta hai baaki course kei chalte level up banana bhul gaye
Nahi beta, aisa kuch nh h thora company main financial issues chl rh h unhe ko resolve krne main lga hu
best one
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 )
Sir solution ko c++ mein b available kra do
Beta, cpp vali series main ye sb cover honge questions.
@@Pepcoding sir cpp wali series kb start hogi
dry run ki value apke video se hi pata chali
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
Thoda sa tough lga but aagya smjh me.
Thoda khraab padhaya majne
@@Pepcoding nhi sr
Sir, leetcode ka Word Break 2 bhi karwa dijiye..
Hanji beta, ek bari jo agenda main questions h vo complete kr le, then ye sb cheeze bhi cover kr lenge
Thanks a lot.. very helpful :)
We can reduce the Time complexity of solution to n^2 😊
Sir web development ke videos kb continue krenge ?
Jaldi he aayegi beta.
Stay tuned☺️
sir hairstyle aacha h
Thank you
@@Pepcoding sir upload web development video.
@@adityashinde3864 sir will do it dont bug him.
fire in water
I think if (j > 0 && dp[j-1] > 0) would be better condition 🤔
no it will fail for some testcases
op.
apple pen
applepenapple
try this code fails here
unordered_set dict(wordDict.begin(), wordDict.end());
int n = s.size();
bool dp[n+1];
memset(dp, 0, sizeof dp);
dp[0] = 1;
for(int i = 0; i < n; i++){
string cur;
for(int j = i; j < n; j++){
cur.push_back(s[j]);
if(dict.count(cur) && dp[i])
dp[j+1] = 1;
}
}
return dp[n];