Word Break | Dynamic Programming

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ม.ค. 2025

ความคิดเห็น • 161

  • @arvindersinghvirdi2456
    @arvindersinghvirdi2456 3 ปีที่แล้ว +44

    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 /\ :)

  • @stith_pragya
    @stith_pragya ปีที่แล้ว +1

    Thank You So Much Sumeet Sir.............🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻 respect++

  • @rohitshinde8478
    @rohitshinde8478 3 ปีที่แล้ว +2

    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

  • @manpreetsinghrana7751
    @manpreetsinghrana7751 ปีที่แล้ว

    Sir, Dynamic Programming could not be made more easier. You are a G.O.A.T.

  • @rv0_0
    @rv0_0 3 ปีที่แล้ว +3

    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.

    • @Pepcoding
      @Pepcoding  3 ปีที่แล้ว +2

      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😊

  • @devesh819
    @devesh819 ปีที่แล้ว

    Sir , never ever I saw such a deep explaination of a question on youtube. Thx a lot for this effort sir.

  • @55_jyotirmaykar30
    @55_jyotirmaykar30 2 ปีที่แล้ว +1

    You are a gem. I cannot in words express how great and honest your efforts are to.
    Pranam🙏🙏🙏🙏

  • @coolbud8541
    @coolbud8541 3 ปีที่แล้ว +7

    for single character it fails, tc: s="a" and set=["a"], use j

  • @chetannain4867
    @chetannain4867 3 ปีที่แล้ว +6

    True hard work and sheer dedication! You are the best!

    • @Pepcoding
      @Pepcoding  3 ปีที่แล้ว +1

      Firr yar thode views dilwao

    • @chetannain4867
      @chetannain4867 3 ปีที่แล้ว

      ​@@Pepcoding Will suggest my friends!

  • @alokesh985
    @alokesh985 3 ปีที่แล้ว +5

    Damn, sir. This tutorial is really really good! The dry runs really make the entire thing so much easier

    • @Pepcoding
      @Pepcoding  3 ปีที่แล้ว +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 )

  • @UtkarshShrivastava6009
    @UtkarshShrivastava6009 2 ปีที่แล้ว

    Can't find a better explaination. This is the best it gets!

  • @083_sarthaksinha3
    @083_sarthaksinha3 3 ปีที่แล้ว +2

    sir, you are awesome I had lots of problems in dp. After watching your playlist of dp now I feel comfortable in dp.

  • @shivanshtiwari7109
    @shivanshtiwari7109 3 ปีที่แล้ว +1

    Aap padhate ho to ek baar me samajh aa jaati hai cheeze.. thank you sir❤️

  • @peeyushkumar1585
    @peeyushkumar1585 3 ปีที่แล้ว

    why the substring function does not take the ith character 23:44 please explain ?

  • @gauravgupta5530
    @gauravgupta5530 2 ปีที่แล้ว

    6:30 is the timeStamo from where you will get hinge. Thank you @SumeetSir

  • @anjalisah1452
    @anjalisah1452 3 ปีที่แล้ว +2

    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

  • @Ashutosh_75
    @Ashutosh_75 ปีที่แล้ว

    Best explanation Sir. Kudos to your efforts.

  • @amanrawat5164
    @amanrawat5164 3 ปีที่แล้ว +2

    Thanks a Lot Sir!!
    Your efforts to explain tough examples and dry run are commendable.

    • @Pepcoding
      @Pepcoding  3 ปีที่แล้ว +1

      Glad you liked it!
      Keep learning.
      And for better experience, visit nados.io, where you will get well curated content and career opportunities.

  • @rajat6365
    @rajat6365 3 ปีที่แล้ว +5

    sir i love the way you teach and appreciate your hard work

    • @Pepcoding
      @Pepcoding  3 ปีที่แล้ว +1

      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 )

  • @noobhike5609
    @noobhike5609 4 ปีที่แล้ว +5

    Sir 20k completed bahut jaldi 100k honge aap tension nahi lene ka🙏🙏❤️🔥🎉🎂

    • @Pepcoding
      @Pepcoding  4 ปีที่แล้ว +3

      Aapka sath bna rahega to jaroor hoga

  • @nehaagrawal670
    @nehaagrawal670 3 ปีที่แล้ว +1

    Can you please create a video for "Find median from data stream"!

  • @dipeshsaili4468
    @dipeshsaili4468 3 ปีที่แล้ว

    Where can I find word wrap problem solution?

  • @nightmare_9
    @nightmare_9 3 ปีที่แล้ว +1

    Fabulous Explanation sir!! This is how a problem should be approached.

    • @Pepcoding
      @Pepcoding  3 ปีที่แล้ว +2

      Thanks a lot and yes you are right

  • @poojajain9935
    @poojajain9935 2 ปีที่แล้ว

    very good explanation and very concise solution of such a tough problem

  • @nishantchaudhary7902
    @nishantchaudhary7902 2 ปีที่แล้ว

    Oh! come on Guys!! no comments on his hair-style.. Seriously?? I mean just look at it .. dosen't it look badass😁

  • @abhinavkumar6584
    @abhinavkumar6584 2 ปีที่แล้ว

    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?

  • @shashankbajpai5659
    @shashankbajpai5659 3 ปีที่แล้ว

    could you explain how to approach its recursive solution?

  • @yogeshagarwal403
    @yogeshagarwal403 3 ปีที่แล้ว +1

    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

    • @Pepcoding
      @Pepcoding  3 ปีที่แล้ว

      It is a problem with maths, permutations and combinations.

  • @ujjalroy65
    @ujjalroy65 2 ปีที่แล้ว +1

    sir i think if you will have "ding" word in your dictionary then this process might fail

  • @nishantshah_
    @nishantshah_ ปีที่แล้ว

    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

  • @ayushgoel9584
    @ayushgoel9584 4 ปีที่แล้ว +1

    sir aise roz ke 2-3 videos daalte rahiye,sir in problems se momentum bna rehta hai

  • @altafmazhar7762
    @altafmazhar7762 3 ปีที่แล้ว

    Thank you so much sir for providing such content for free.

    • @Pepcoding
      @Pepcoding  3 ปีที่แล้ว

      There is much more content on nados.pepcoding.com
      Do check out

  • @codeblooded6760
    @codeblooded6760 4 ปีที่แล้ว +2

    Time Complexity for this will be O(N^3) right?

    • @Pepcoding
      @Pepcoding  4 ปีที่แล้ว

      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.

    • @swastiksingh8452
      @swastiksingh8452 3 ปีที่แล้ว +4

      @@Pepcoding lol, answering yes or no would have taken less time than that

    • @karanveersingh5535
      @karanveersingh5535 3 ปีที่แล้ว

      @@swastiksingh8452 😂😂true

  • @learningmaths786
    @learningmaths786 11 หลายเดือนก่อน

    thanks sir for this explanation code aceepted ☺☺

  • @ssr5052
    @ssr5052 4 ปีที่แล้ว

    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.

  • @navaugustt
    @navaugustt 2 ปีที่แล้ว

    nice sir ji🙌

  • @raghavkhanna6090
    @raghavkhanna6090 4 ปีที่แล้ว +1

    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

  • @DivyaPrakash-bj6zk
    @DivyaPrakash-bj6zk 3 ปีที่แล้ว

    Sir ye hairstyle mei ek no. lgte h ....Captain Cool.

  • @youngshahrukhkhan8179
    @youngshahrukhkhan8179 3 ปีที่แล้ว

    Very Nice Explanation......Keep making videos

    • @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
      th-cam.com/users/Pepcodingabout?view_as=subscriber

  • @rishabhchirania1995
    @rishabhchirania1995 3 ปีที่แล้ว

    ye baat abhi nhi smaj ayegi but thoda aage chlkar smaj aane layegi...truely make sense..thnks

    • @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 )

  • @ayushgoel9584
    @ayushgoel9584 4 ปีที่แล้ว +8

    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

    • @Pepcoding
      @Pepcoding  4 ปีที่แล้ว +12

      Hanji beta, thora company main kch issues chl rh h vo resolve krne main lga hu. Jaldi he resume kruga content

  • @shashankgarg8128
    @shashankgarg8128 4 ปีที่แล้ว

    Sir osm videos , all videos are super cool and i also recommend to my friends to watch your videos.

    • @Pepcoding
      @Pepcoding  4 ปีที่แล้ว

      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

  • @dreamarena5312
    @dreamarena5312 4 ปีที่แล้ว

    I understand all of your video.
    Can you please make video on word wrap

    • @Pepcoding
      @Pepcoding  4 ปีที่แล้ว

      Hanji beta, ek bari jo agenda main questions h vo complete kr le, then ye sb cheeze bhi cover kr lenge

    • @dreamarena5312
      @dreamarena5312 4 ปีที่แล้ว

      @@Pepcoding thankyou sir

  • @gyaneshsharma4325
    @gyaneshsharma4325 3 ปีที่แล้ว +1

    sir aise baalo pe placement mil jati h kya??

  • @shahidagarwal2868
    @shahidagarwal2868 4 ปีที่แล้ว

    Sir aapka ek month se koi video nahi aaya... Seriously missing your teaching... I hope everything is fyn sir... Please resume soon.

    • @Pepcoding
      @Pepcoding  4 ปีที่แล้ว +1

      Beta, soon we are going to resume, feeling very strong about 10th jan.

  • @akshaysolanki5164
    @akshaysolanki5164 4 ปีที่แล้ว +6

    Sir plz also cover TEXT JUSTIFICATION problem. It is also a hard dp interview question.

    • @Pepcoding
      @Pepcoding  4 ปีที่แล้ว +6

      Hanji next wahi kraunga

  • @shubhamagarwal2998
    @shubhamagarwal2998 3 ปีที่แล้ว

    Thanks a lot to your contribution to cs society....great job by popcoding

  • @arijitdey8419
    @arijitdey8419 3 ปีที่แล้ว

    Very good explaination sirji ..keep making more videos of dp

    • @Pepcoding
      @Pepcoding  3 ปีที่แล้ว +1

      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

  • @002_adityaagrawal2
    @002_adityaagrawal2 3 ปีที่แล้ว

    happy teacher's day sir

  • @shishirsingh2338
    @shishirsingh2338 3 ปีที่แล้ว

    Sir, This solution is giving runtime error(value of dp[s.length()-1] is very large) for leetcode 139. word break problem.

    • @chickusingh6166
      @chickusingh6166 3 ปีที่แล้ว +2

      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.

    • @subhadipbisai2808
      @subhadipbisai2808 3 ปีที่แล้ว

      @@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

  • @anjandey6089
    @anjandey6089 3 ปีที่แล้ว

    this solution in leetcode(139) gives Runtime error for some testcase. Can anyone figure out this??

    • @chickusingh6166
      @chickusingh6166 3 ปีที่แล้ว

      because of integer overflow.

    • @chickusingh6166
      @chickusingh6166 3 ปีที่แล้ว

      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.

  • @yashlohiya5388
    @yashlohiya5388 3 ปีที่แล้ว

    sir rectangle painting probelem please se discuss kardijiye

  • @ayushgoel9584
    @ayushgoel9584 4 ปีที่แล้ว

    Sir aapne dp and hashmaps ke baad konsa topic plan kia hai level2 mein?

    • @Pepcoding
      @Pepcoding  4 ปีที่แล้ว

      Trees

    • @ayushgoel9584
      @ayushgoel9584 4 ปีที่แล้ว

      @@Pepcoding Best hai sir, jaldi se jaldi kara dijiye

  • @priyanshujain2201
    @priyanshujain2201 4 ปีที่แล้ว

    Sir plz make videos we are waiting for you your explanation is tooo good. Please continue sir

    • @Pepcoding
      @Pepcoding  3 ปีที่แล้ว +5

      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.

  • @keshavdwivedi6591
    @keshavdwivedi6591 3 ปีที่แล้ว

    Gajab Hairstyle

  • @jatinkumar4410
    @jatinkumar4410 4 ปีที่แล้ว

    Nice explanation sir.
    Please upload a video for rat in a maze (movement possible in all directions) and m colouring graph problem.

    • @Pepcoding
      @Pepcoding  4 ปีที่แล้ว +3

      Beta rat in maze flood fill naam se recursion mei hai aur graphs mei print all paths naam se

    • @jatinkumar4410
      @jatinkumar4410 4 ปีที่แล้ว

      @@Pepcoding ok sir I will learn from there. Thank you.

  • @rudreshmishra3096
    @rudreshmishra3096 3 ปีที่แล้ว

    understanding made very simple!!!.

    • @Pepcoding
      @Pepcoding  3 ปีที่แล้ว +1

      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 )

  • @deepali-e6f
    @deepali-e6f 3 ปีที่แล้ว

    For this solution TC will be O(N^2) and SC would be O(N). Right?

    • @chickusingh6166
      @chickusingh6166 3 ปีที่แล้ว +2

      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++.

    • @deepali-e6f
      @deepali-e6f 3 ปีที่แล้ว +1

      @@chickusingh6166 Thank you!

    • @lakshayrastogi7640
      @lakshayrastogi7640 2 ปีที่แล้ว

      @@chickusingh6166 can you send me the c++ code.

  • @shivamahuja840
    @shivamahuja840 4 ปีที่แล้ว

    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.

    • @Pepcoding
      @Pepcoding  4 ปีที่แล้ว

      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.

    • @username-tg7if
      @username-tg7if 3 ปีที่แล้ว +2

      replace i+1 with i-j+1

    • @shreyasaxena5169
      @shreyasaxena5169 3 ปีที่แล้ว +1

      @@username-tg7if I was stuck here. Thank you so much.

    • @username-tg7if
      @username-tg7if 3 ปีที่แล้ว

      @@shreyasaxena5169 most welcome

  • @priyansh88
    @priyansh88 3 ปีที่แล้ว +3

    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

  • @sakshamkumarsharma2309
    @sakshamkumarsharma2309 4 ปีที่แล้ว

    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

    • @Pepcoding
      @Pepcoding  4 ปีที่แล้ว

      Beta, time lagega. Doosri revision mein ho jaenge

    • @sakshamkumarsharma2309
      @sakshamkumarsharma2309 4 ปีที่แล้ว

      @@Pepcoding okay thank you sir

  • @sambitmahapatra1553
    @sambitmahapatra1553 3 ปีที่แล้ว

    Can we use this method and also print those 8 different strings ?

  • @yourbestie4138
    @yourbestie4138 3 ปีที่แล้ว +1

    pepcoding loves mango icecream
    student loves sumeet sirs hair cream
    well explained sir👍

  • @harshitsaluja3493
    @harshitsaluja3493 3 ปีที่แล้ว

    After code you should have done dry run correct way

    • @Pepcoding
      @Pepcoding  3 ปีที่แล้ว

      For better experience visit on nados.pepcoding.com

  • @himanshupatel4063
    @himanshupatel4063 4 ปีที่แล้ว

    Sir Possible ho toh Ap Apna daily routine schedule share krna

    • @Pepcoding
      @Pepcoding  4 ปีที่แล้ว +1

      bhai, roj badalta hai

  • @HarshitSharma-xk8qh
    @HarshitSharma-xk8qh 4 ปีที่แล้ว

    sir web dev ki nayi video kab ayegi?aur robotjs install nahi ho raha hai npm uska bhi solution

    • @Pepcoding
      @Pepcoding  4 ปีที่แล้ว +1

      Beta abhi new script likh rha hun

    • @Pepcoding
      @Pepcoding  4 ปีที่แล้ว +1

      Poori hone wali hai

  • @satvrii
    @satvrii ปีที่แล้ว

    ❤❤

  • @hetbrahmbhatt2157
    @hetbrahmbhatt2157 3 ปีที่แล้ว

    What is the time complexity of this solution?

  • @sukanyasinha3583
    @sukanyasinha3583 4 ปีที่แล้ว

    great explanation Sir webdev ki videos bhi upload kar djiye. please .

  • @vishwashdwivedi9469
    @vishwashdwivedi9469 3 ปีที่แล้ว

    Thank you Sir !

  • @taruntomar7795
    @taruntomar7795 3 ปีที่แล้ว +1

    Thank you sir

    • @Pepcoding
      @Pepcoding  3 ปีที่แล้ว +1

      All the best

  • @ayushgoel9584
    @ayushgoel9584 4 ปีที่แล้ว

    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

    • @Pepcoding
      @Pepcoding  4 ปีที่แล้ว

      Ji beta, koshish yhe kr rh hu

    • @ayushgoel9584
      @ayushgoel9584 4 ปีที่แล้ว

      @@Pepcoding Ok thank you sir

  • @ritikjalal117
    @ritikjalal117 4 ปีที่แล้ว +1

    sir dp ki bachi hui videos level 2 ki dal dijiye

    • @Pepcoding
      @Pepcoding  4 ปีที่แล้ว

      Hanji beta, bna rh hu, under process h

  • @aniketgahiware1557
    @aniketgahiware1557 3 ปีที่แล้ว

    awesome

    • @Pepcoding
      @Pepcoding  3 ปีที่แล้ว

      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

  • @harshgarg7025
    @harshgarg7025 3 ปีที่แล้ว

    love the way you teach sirji

    • @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😊

  • @subhojitmitra239
    @subhojitmitra239 4 ปีที่แล้ว

    Sr lagta hai baaki course kei chalte level up banana bhul gaye

    • @Pepcoding
      @Pepcoding  4 ปีที่แล้ว

      Nahi beta, aisa kuch nh h thora company main financial issues chl rh h unhe ko resolve krne main lga hu

  • @nikhilnagar3253
    @nikhilnagar3253 4 ปีที่แล้ว

    best one

    • @Pepcoding
      @Pepcoding  4 ปีที่แล้ว

      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 )

  • @rohitantil9534
    @rohitantil9534 3 ปีที่แล้ว

    Sir solution ko c++ mein b available kra do

    • @Pepcoding
      @Pepcoding  3 ปีที่แล้ว

      Beta, cpp vali series main ye sb cover honge questions.

    • @rohitantil9534
      @rohitantil9534 3 ปีที่แล้ว

      @@Pepcoding sir cpp wali series kb start hogi

  • @celciusentertainments
    @celciusentertainments 3 ปีที่แล้ว

    dry run ki value apke video se hi pata chali

    • @Pepcoding
      @Pepcoding  3 ปีที่แล้ว +1

      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

  • @aman6561
    @aman6561 4 ปีที่แล้ว

    Thoda sa tough lga but aagya smjh me.

    • @Pepcoding
      @Pepcoding  4 ปีที่แล้ว

      Thoda khraab padhaya majne

    • @aman6561
      @aman6561 4 ปีที่แล้ว

      @@Pepcoding nhi sr

  • @sruthitalluri3107
    @sruthitalluri3107 4 ปีที่แล้ว

    Sir, leetcode ka Word Break 2 bhi karwa dijiye..

    • @Pepcoding
      @Pepcoding  4 ปีที่แล้ว

      Hanji beta, ek bari jo agenda main questions h vo complete kr le, then ye sb cheeze bhi cover kr lenge

  • @mindfulshreya
    @mindfulshreya 3 ปีที่แล้ว

    Thanks a lot.. very helpful :)

  • @appukhotey4255
    @appukhotey4255 3 ปีที่แล้ว

    We can reduce the Time complexity of solution to n^2 😊

  • @RahulGupta-rn2id
    @RahulGupta-rn2id 4 ปีที่แล้ว

    Sir web development ke videos kb continue krenge ?

    • @Pepcoding
      @Pepcoding  4 ปีที่แล้ว

      Jaldi he aayegi beta.
      Stay tuned☺️

  • @tapans2998
    @tapans2998 4 ปีที่แล้ว +1

    sir hairstyle aacha h

    • @Pepcoding
      @Pepcoding  4 ปีที่แล้ว

      Thank you

    • @adityashinde3864
      @adityashinde3864 4 ปีที่แล้ว

      @@Pepcoding sir upload web development video.

    • @us-xf3kk
      @us-xf3kk 4 ปีที่แล้ว

      @@adityashinde3864 sir will do it dont bug him.

  • @AnkitSingh-tm5dp
    @AnkitSingh-tm5dp 2 ปีที่แล้ว

    fire in water

  • @decostarkumar2562
    @decostarkumar2562 3 ปีที่แล้ว +1

    I think if (j > 0 && dp[j-1] > 0) would be better condition 🤔

    • @skp6753
      @skp6753 2 ปีที่แล้ว

      no it will fail for some testcases

  • @ravikamble8142
    @ravikamble8142 4 ปีที่แล้ว

    op.

  • @shubhamjain9433
    @shubhamjain9433 2 ปีที่แล้ว +1

    apple pen
    applepenapple
    try this code fails here

    • @shubhamjain9433
      @shubhamjain9433 2 ปีที่แล้ว

      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];