Wildcard Matching Dynamic Programming | Leetcode Hard Solutions

Поділитися
Вставка
  • Опубліковано 25 сер 2024
  • 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 for the Wildcard Pattern Matching problem using Dynamic Programming in JAVA. In this problem,
    1. You are given two strings S1 and S2. S1 represents a text and S2 represents a wildcard pattern.
    2. You have to print 'true' if the wildcard pattern is matched with the given text, otherwise print 'false'.
    The wildcard pattern can include the characters '?' and '*'
    '?' - matches any single character
    '*' - matches any sequence of characters (including the empty sequence).
    To attempt and submit this question, click here: www.pepcoding....
    For a better experience and more exercises, VISIT: www.pepcoding....
    #dynamicprogramming #leetcode
    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

КОМЕНТАРІ • 187

  • @SeemantAggarwal
    @SeemantAggarwal 3 роки тому +39

    This question has been explained by many honestly, but in every explanation they just start with DP, this is the ONLY tutorial that explains it step by step. why DP? How DP? and most importantly the formula is derived by understanding and not just asked to mug up. Crisp and brilliant explanation.

    • @Pepcoding
      @Pepcoding  3 роки тому +4

      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 )

    • @ShashankRustagiCSE
      @ShashankRustagiCSE 2 роки тому

      but striver said he will explain all three approaches i.e. top down, bottom up and space optimised dp. Sir do you think he is the best?

    • @SeemantAggarwal
      @SeemantAggarwal 2 роки тому +1

      @@ShashankRustagiCSE best vo h jiska tumhe smj aye

  • @anusatyachoudhary7382
    @anusatyachoudhary7382 3 роки тому +34

    This is the best explanation of this question on the internet, especially the explanation of the optimisation in '*'.

    • @Pepcoding
      @Pepcoding  3 роки тому +2

      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/What-are-the-good-websites-to-learn-data-structures-and-algorithms )
      Keep learning and keep loving Pepcoding😊

    • @SudhanshuKumar-lp1nr
      @SudhanshuKumar-lp1nr 3 роки тому

      Can someone also provide the solution for top down approach for this question

  • @thesaloniguptaa
    @thesaloniguptaa 3 роки тому +24

    Sir, I have watched most of the leetcode hard type questions from your channel, you are really doing a great job. Thanks for providing this content for free.

    • @Pepcoding
      @Pepcoding  3 роки тому +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, we request a review - g.page/Pepcoding/review?rc

    • @thesaloniguptaa
      @thesaloniguptaa 3 роки тому +2

      @@Pepcoding Done :)

    • @SudhanshuKumar-lp1nr
      @SudhanshuKumar-lp1nr 3 роки тому

      Can someone also provide the solution for top down approach for this question

  • @user13443fg
    @user13443fg Місяць тому +1

    Impressed how you taught! I was looking for bottomup speacially for star character. I understood it because of you :)

  • @factswithai2
    @factswithai2 3 роки тому +1

    Sir wo baat hai na jo teacher log bolte hain ki " beta jitni baar puchhoge utni baar samjhaaunga" , sir aap uske EPITOME ho. Aapni itni baar ek hi baat dohrai hi na ki, koi student samjhe bina rehe hi nhi sakta. Thank u so much sir, respect++ && as usual "EAST HO YA WEST SUMEET SIR IS THE BEST".

    • @Pepcoding
      @Pepcoding  3 роки тому

      Thank you for appreciating. keep motivating, keep learning and keep loving Pepcoding😊

  • @rajverma5454
    @rajverma5454 3 роки тому +7

    Best explanation Sir, Jab iska code GFG pe dekha toh laga keyboard tod du, ab aisa lag raha h ek do aur khareed lu.

    • @Pepcoding
      @Pepcoding  3 роки тому

      If you like my efforts, I request a review
      g.page/Pepcoding/review?rc
      You can subscribe to our channel here
      ua-cam.com/users/Pepcodingabout?view_as=subscriber
      For clearing your doubts, you can join our community on telegram
      t.me/pepcoding

    • @sahilverma4142
      @sahilverma4142 3 роки тому

      epic comment i had seen ever.

    • @abhinavgarg5611
      @abhinavgarg5611 2 роки тому +1

      LMAO ded

  • @aindrilasaha1592
    @aindrilasaha1592 3 роки тому +3

    Wonderful!! Never thought the solution to this question could be explained so clearly. Everywhere on the net we find just code with no explanation or reasoning, but not in your channel. Thanks!!

    • @SudhanshuKumar-lp1nr
      @SudhanshuKumar-lp1nr 3 роки тому

      Can someone also provide the solution for top down approach for this question??

  • @devanshmesson2777
    @devanshmesson2777 3 роки тому +1

    This is the best explanation for this problem.
    This man is using all his energy to explain the "why" of the solution of this problem!
    Thank you so so so so so much sir!
    I watched till the end!

  • @techscout4051
    @techscout4051 3 роки тому +2

    Highly underrated channel , truly deserve much !

  • @amitguptapc
    @amitguptapc 3 роки тому +2

    One of the best explanation so far. This channel needs to be on the top for best coding tutorials(Especially for DP).

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

    • @SudhanshuKumar-lp1nr
      @SudhanshuKumar-lp1nr 3 роки тому

      Can someone also provide the solution for top down approach for this question??

  • @shivangipandey4669
    @shivangipandey4669 3 роки тому +1

    Your way of teaching is really appreciating.It becomes very easy to understand.Happy Teachers Day to such a awesome teacher

  • @neerajbhatia2008
    @neerajbhatia2008 2 роки тому +1

    100% agree to what Seemant said, i love how Sumeet sir explains things, making logic so simple to implement. These videos are now becoming my normal timepass, when i get bored i open youtube and watch pepcoding, nostalgic, i am getting addicted to DS now :)

    • @Pepcoding
      @Pepcoding  2 роки тому

      We are really glad that it could be interesting and helpful. For better experience and precisely organised content visit - naods.pepcoding.com
      Don't forget to follow us on Instagram instagram.com/pepcoding/

  • @anujsoni6089
    @anujsoni6089 Рік тому

    i have never seen this much level of perfectt explaination ❤❤❤❤

  • @SumitSingh-wz3wt
    @SumitSingh-wz3wt 2 роки тому +1

    I don't think these kind of question can be solved without watching the solutions.

  • @karthikshetty2875
    @karthikshetty2875 3 роки тому +2

    Just a minor correction, i and j should start from dp.length and do[0].length. Please correct me if I am wrong. Btw very nice explanation to detail, loved it!

    • @karanveersingh5535
      @karanveersingh5535 2 роки тому

      Correct

    • @shreedharkushwaha3100
      @shreedharkushwaha3100 2 роки тому

      Thank you bhai bahut der baad aapka comment dekha tab jake submit huaa 2+ hr. Time barbaad ho gya dry run karne me . Love u bro and thank you so much❤️❤️❤️

  • @rishabhgoyal8110
    @rishabhgoyal8110 2 роки тому +1

    His smile at 28:33 says it all. God bless him.

  • @ManojKrVerma-vw4dx
    @ManojKrVerma-vw4dx 3 роки тому +1

    sumit sir hum to aapke fan ho gaye.... Thanku for such insightful explaination.. best explaination on the internet for the problem....

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

  • @dipanshukumrawal4880
    @dipanshukumrawal4880 3 роки тому +1

    Sir with the help of your explanation now i can able to solve the hard problems of dp
    thankyou so much sir

    • @Pepcoding
      @Pepcoding  3 роки тому

      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 )

    • @SudhanshuKumar-lp1nr
      @SudhanshuKumar-lp1nr 3 роки тому

      Can someone also provide the solution for top down approach for this question??

  • @apoorvdixit2856
    @apoorvdixit2856 3 роки тому +1

    sir iss quetion mei apne quatle aam macha diya , maza aagya. bhaisab.

    • @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/What-are-the-good-websites-to-learn-data-structures-and-algorithms )
      Keep learning and keep loving Pepcoding😊

  • @krynx9.965
    @krynx9.965 3 роки тому +1

    Cannot be explain in any better way than this !! Thank you.

    • @Pepcoding
      @Pepcoding  3 роки тому +1

      Glad it was helpful! 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 )

  • @rahulagrawal3611
    @rahulagrawal3611 3 роки тому

    Bahi wahh.. HATS OFF to you, the way you explained this prob. and optimization.. Next level... Feeling lucky that I can match your language preference also.. spending 40 mins in this lecture (worst case 2*40 mins for a revisit) would be better that better than looking other videos that has shorter duration. Of course vide time complexity matters a lot but can be ignored at the cost of getting clarity on solution.

  • @codebot1027
    @codebot1027 3 роки тому

    I Can't Thank You Enough! This Is The Best Channel For DSA Videos!
    Thank You So Much Man!

  • @sadmanabedin1203
    @sadmanabedin1203 2 роки тому

    Great explanation bro,
    For the optimization part for the star I tried something else which worked and my solution got accepted.
    My optimization:
    store the variable of the first true column (rightmost in this case, since we'll be traversing from right) in the immediate lower row, let's say the variable is last_true_column. So for any column with star in the current row, we'll check if that column is less than or equal to last_true_column or not, if yes we'll put True, False otherwise.

  • @obulpathi2729
    @obulpathi2729 Рік тому

    Very good explanation..solution could reach more people if you could explain it in English.

  • @r-rk
    @r-rk 3 роки тому +1

    Generalize where the concept of DP is used, (i mean not the overlapping problems )
    wildcard Matching , Knapsack problem, no of ways in grid, etc like this make a video on listing out how different problems can be solved using Dynamic Programming. (List out all problems that can be solved with DP concept..^

  • @trivenigawali694
    @trivenigawali694 2 роки тому

    Best ever explaination💯🔥

  • @fanigo138
    @fanigo138 3 роки тому +1

    Amazing explanation sir! Thank you so much for making these hard questions easy!!

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

    • @tapaskumarswain9862
      @tapaskumarswain9862 3 роки тому

      class Solution:
      def isMatch(self, s: str, p: str) -> bool:
      dp = [[None for _ in range(len(s)+1)] for k in range(len(p)+1)]

      for i in range(len(dp)-1,-1,-1):
      for j in range(len(dp[0])-1,-1,-1):
      if i == len(dp)-1 and j == len(dp[0])-1:
      dp[i][j] = True
      # elif i == len(dp)-1 and p[i] == "*":
      # dp[i][j] = True


      elif i == len(dp)-1:
      dp[i][j] = False

      elif j == len(dp[0])-1:
      if p[i] == "*":
      dp[i][j] = dp[i+1][j]
      else:
      dp[i][j] = False
      else:
      if p[i] == "?":
      dp[i][j] == dp[i+1][j+1]
      elif p[i] == "*":
      dp[i][j] == dp[i+1][j] or dp[i][j+1]
      elif p[i] == s[j]:
      dp[i][j] = dp[i+1][j+1]
      else:
      dp[i][j] = False

      return dp[0][0]

      i am getting wrong answer in the "or" step.Please Help

  • @PrinceKumar-el7ob
    @PrinceKumar-el7ob 2 роки тому

    very elegant explanation although i am a big fan of recursive solution but i will pass this tabulation solution.

  • @vishaldange2163
    @vishaldange2163 3 роки тому

    Best best and the very best expalnation

  • @ghanshyamsinghal9335
    @ghanshyamsinghal9335 2 роки тому

    very good explanation sir

  • @abhishek__anand__
    @abhishek__anand__ Рік тому

    Superb Explanation

  • @enigma2886
    @enigma2886 3 роки тому +1

    Sir jab koi new problem solve kare dp ki , to ye andaaz kaise lagae ki bottom right se bhare ya fir top left se. ??

  • @divyamgupta6415
    @divyamgupta6415 3 роки тому +1

    lajawab optimisation sirji.

    • @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/How-do-I-start-learning-or-strengthen-my-knowledge-of-data-structures-and-algorithms )

  • @aasthasinha1790
    @aasthasinha1790 3 роки тому

    cant be more thankful

  • @deepikapatra1065
    @deepikapatra1065 3 роки тому +1

    How can he explain so well? Too good

    • @jadanabil8044
      @jadanabil8044 3 роки тому

      How is he putting blank position at the end now? Any idea?

    • @Pepcoding
      @Pepcoding  3 роки тому

      Thank you so much beta

  • @sachinsharma905
    @sachinsharma905 3 роки тому

    The best explanation one can get.

  • @akatsuki1363
    @akatsuki1363 3 роки тому +1

    Kaise sochate ho kaisa🤯👌👌

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

  • @Jai-yn3te
    @Jai-yn3te 3 роки тому +1

    Amazing explanation sir!

  • @varuntaneja7073
    @varuntaneja7073 2 роки тому

    If I am stuck on a question and I see you have a video on it , I can be sure that I wont require any other video's explanation.

  • @peaceandlov
    @peaceandlov 3 роки тому +3

    legend!!

  • @carry1449
    @carry1449 2 роки тому

    kamaal ho paaji tussi ♥

  • @dirghrajkushawaha3822
    @dirghrajkushawaha3822 3 роки тому

    sir... aap mahan hooo

    • @Pepcoding
      @Pepcoding  3 роки тому +1

      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😊

  • @vedantmondkar9963
    @vedantmondkar9963 3 роки тому +1

    Best line,
    * ne 'a' ko kha liya tab bhi zinda hai 😂
    nice explaination sir 👏

  • @nikhilnischal4019
    @nikhilnischal4019 3 роки тому

    Not a single dislike... Hatts off to you sir. Awesome explaination

    • @shang_chi4651
      @shang_chi4651 3 роки тому

      Do aa gaye bhai ab🥺 kaun hain ye log, kahan se aate hain ye

    • @anshsarin19
      @anshsarin19 3 роки тому

      @@shang_chi4651 insaan h ye log or apne-apne gharo se aate hai

    • @shang_chi4651
      @shang_chi4651 3 роки тому

      @@anshsarin19 😅 par dislike kyun karke jaate🥺

  • @sandeepchaudhary8222
    @sandeepchaudhary8222 2 роки тому

    Thanks for everything you doing sir

    • @Pepcoding
      @Pepcoding  2 роки тому

      My pleasure.
      For better experience and well organised content sign up on nados.io
      And for being updated follow us on Instagram instagram.com/pepcoding/

  • @saurabhmadnawat6856
    @saurabhmadnawat6856 3 роки тому +1

    Concept clear👌👌....

  • @AnkitKumar-fj8ex
    @AnkitKumar-fj8ex 3 роки тому +1

    awesome explanation sir

    • @Pepcoding
      @Pepcoding  3 роки тому

      Thankyou beta, I 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 write a few words about us here (www.quora.com/How-do-I-start-learning-or-strengthen-my-knowledge-of-data-structures-and-algorithms )

  • @altafmazhar7762
    @altafmazhar7762 2 роки тому

    Nice explanation sirji

    • @Pepcoding
      @Pepcoding  2 роки тому

      Please visit nados.pepcoding.com for more detailed and curated content on DSA, Web Dev etc for free

  • @kanishkanand1555
    @kanishkanand1555 2 роки тому

    best explanation

  • @suryapratapsingh7130
    @suryapratapsingh7130 2 роки тому

    Best explanation on the internet!

    • @Pepcoding
      @Pepcoding  2 роки тому

      Glad you liked it.
      Keep learning.
      And for better experience and well organised content explore nados.pepcoding.com

  • @CodeSuccessChronicle
    @CodeSuccessChronicle 2 роки тому

    Vera Level Bro very clear Thank you so much...................

  • @navneetlohia2407
    @navneetlohia2407 3 роки тому +1

    what an explanation, thanks a lot....

    • @Pepcoding
      @Pepcoding  3 роки тому

      Glad it was helpful 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 )

  • @SHASHANKRUSTAGII
    @SHASHANKRUSTAGII 3 роки тому

    as the dp is of boolean type, how can it be assigned to int i as type mismatch is there. please explain. your code is not running in c++

  • @gagandeepsingh2925
    @gagandeepsingh2925 2 роки тому

    Great explanation

    • @Pepcoding
      @Pepcoding  2 роки тому +1

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

  • @raushanraj_99
    @raushanraj_99 Рік тому

    Thanks alot sir 🙏🙏

  • @indranilchakraborty5949
    @indranilchakraborty5949 3 роки тому +1

    Best of best...🙏🙏🙏

    • @Pepcoding
      @Pepcoding  3 роки тому

      Thankyou beta for being our constant supporter😊
      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 )

  • @yourbestie4138
    @yourbestie4138 3 роки тому

    superb explanation sir..Sir can please make a series from cses problem set on graph and tress ,Coz there is none of them have done clear cut playlist on them

  • @harshtekriwal131
    @harshtekriwal131 3 роки тому

    Sir video ekdum smjh agyi, bas ek suggestion hai ki ise top to bottom krwaie, bcus wo zyada easy hota hai undersstand krne mei , ulta loop zyada confusing lagta hai ! :)

    • @Pepcoding
      @Pepcoding  3 роки тому +1

      next top to bottom karwai hai

  • @GirishJain
    @GirishJain 2 роки тому

    I think for dp[i][j] shouldn't we consider p[i-1] and s[i-1] because dp[i][j] will tell us i size and j size of s and p respectively instead of indexes

  • @ayushbhardwaj3296
    @ayushbhardwaj3296 3 роки тому +1

    what a effort .....hats off

  • @youngshahrukhkhan8179
    @youngshahrukhkhan8179 3 роки тому

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

  • @sanjaysingh5007
    @sanjaysingh5007 Рік тому

    Can't we take blank space at the 0th index ?

  • @vikaskumar-hc1cs
    @vikaskumar-hc1cs 2 роки тому

    maja aa gya ❤❤🔥🔥

  • @clutchh_god
    @clutchh_god 4 роки тому +1

    great video.. pls also upload video on leet code #10. Regular Expression Matching

    • @Pepcoding
      @Pepcoding  3 роки тому +2

      done. please check out the latest video.
      If you like my efforts, I request a review
      g.page/Pepcoding/review?rc

    • @clutchh_god
      @clutchh_god 3 роки тому +1

      @@Pepcoding Thank you sir!!

  • @RupinderSingh-gs8hz
    @RupinderSingh-gs8hz 3 роки тому +1

    Best explanation

    • @Pepcoding
      @Pepcoding  3 роки тому

      Glad you think so! 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 )

  • @NaveenRawat51
    @NaveenRawat51 3 роки тому

    as always only one word. Awesome :-)

  • @amolgautam488
    @amolgautam488 2 роки тому

    Thank you so much.

    • @Pepcoding
      @Pepcoding  2 роки тому

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

  • @mohitahlawat4944
    @mohitahlawat4944 3 роки тому

    best explanation!(especially for that * part)

    • @Pepcoding
      @Pepcoding  3 роки тому +2

      Glad you think so!

    • @Pepcoding
      @Pepcoding  3 роки тому +1

      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 )

    • @SudhanshuKumar-lp1nr
      @SudhanshuKumar-lp1nr 3 роки тому

      Can someone also provide the solution for top down approach for this question??

  • @bloody9162
    @bloody9162 2 роки тому

    Gratitude!

  • @samchau8011
    @samchau8011 2 роки тому

    Awesome!

  • @b.sainathreddy4567
    @b.sainathreddy4567 3 роки тому +1

    i think there was a small mistake i should start from dp.length not from dp.length-1 similarlly j and trivial cases also changes to i == dp.length and j == dp[0].length

  • @silverbullet_6
    @silverbullet_6 3 роки тому

    thanks bhaiya mai to string ko leke soch he nhi raha tha ......akele char leke krta gaya 6 ghnata nikalgaya.

    • @Pepcoding
      @Pepcoding  3 роки тому +1

      Haha..koi nh beta, atleast you tried to find an approach.
      Keep learning and keep growing!😊

  • @ANILKUMAR-mi5xm
    @ANILKUMAR-mi5xm 3 роки тому

    true teacher. wow

  • @dipuprasad9196
    @dipuprasad9196 3 роки тому

    Thank you very much sir

  • @SHASHANKRUSTAGII
    @SHASHANKRUSTAGII 3 роки тому

    can you solve this top down?

  • @mayur_madhwani03
    @mayur_madhwani03 2 роки тому

    Woooooooooooooooooooooooooow

  • @nikunjgoyal1955
    @nikunjgoyal1955 Рік тому

    Best !!!

  • @babayaga715
    @babayaga715 4 роки тому

    sir its a very humble request ...please sir is topic k baad sliding window technique se releated videos bna dijiyega ...kaafi problem aati h usme..and thankyou for this content sir

  • @adarshshrivastava6326
    @adarshshrivastava6326 3 роки тому

    Why it isnt running in interview bit

  • @Deepusingh-ct6kx
    @Deepusingh-ct6kx 4 роки тому +1

    thank you so much sir for all these, m thoda slow hu😅

  • @SudhanshuKumar-lp1nr
    @SudhanshuKumar-lp1nr 3 роки тому

    Can someone also provide the solution for top down approach for this question??

  • @sohaibmansuri279
    @sohaibmansuri279 2 роки тому

    when s="aa";
    p="*"
    then it give wrong answer plz help

  • @aakarshitrekhi8071
    @aakarshitrekhi8071 3 роки тому

    awesome explaination

    • @Pepcoding
      @Pepcoding  3 роки тому +1

      keep motivating, keep learning and keep loving Pepcoding😊

  • @payalsagar1808
    @payalsagar1808 3 роки тому

    Thankyou sir😁

  • @adityasinha1149
    @adityasinha1149 3 роки тому +1

    Sir is it necessary to add blanks in dp table?

    • @Pepcoding
      @Pepcoding  3 роки тому +1

      no, it is to make it easy for us.

    • @adityasinha1149
      @adityasinha1149 3 роки тому

      @@Pepcoding thank you sir for your quick reply

  • @narendrak1465
    @narendrak1465 Рік тому

    Maybe once in a generation teacher he is

  • @jadanabil8044
    @jadanabil8044 3 роки тому

    Sir, why in this particular problem you have kept blank string at the end of the matrix and not at the start like any other dp problem. Can you please explain this?

    • @shang_chi4651
      @shang_chi4651 3 роки тому

      LCS aur is problem mein sir ne aise hi last mein rakh diya blank, aiss koi compulsory nhi hai. Bas meaning assign karna aana chahiye cells ko

  • @siddhantrawat2868
    @siddhantrawat2868 Рік тому

    error when s=aa and p=*

  • @tanishjain9544
    @tanishjain9544 3 роки тому

    Sir, can we do it using top down approach, as we do in lcs,..any specific reason to use bottom up?

  • @aditya-st1sv
    @aditya-st1sv 2 роки тому

    respect ++..♾️

    • @Pepcoding
      @Pepcoding  2 роки тому

      Thanks :) Visit nados.pepcoding.com for more videos like this

  • @mr.naresh3004
    @mr.naresh3004 2 роки тому

    💯💯👏👏

  • @shreedharkushwaha3100
    @shreedharkushwaha3100 2 роки тому

    ❤️❤️❤️

  • @b.sainathreddy4567
    @b.sainathreddy4567 3 роки тому

    sir can we do al kinds of dp problems in top down and bottom up approach or it depends on the question

    • @Pepcoding
      @Pepcoding  3 роки тому +1

      You can do them any way but comparatively bottom up apporach is easier to think.

  • @satyam18_
    @satyam18_ 3 роки тому

    Sir aapke hisab se iski bruteforce approach kya hogi ? Backtracking se bhi ho sakta hai na ye question?

    • @Pepcoding
      @Pepcoding  3 роки тому +1

      sare dp questions recursion se ho jate hain. Iska formula he recursion ki calls mei dikhega.

  • @NehaKumari-cx6un
    @NehaKumari-cx6un 3 роки тому

    Thanku sir

  • @AYJ959
    @AYJ959 Рік тому

    31:55 ( my mind : in dono ka or ind ono ka or indono ka or oh indore )

  • @deepanshukumar7290
    @deepanshukumar7290 3 роки тому

    sir, last column direct he false kar du ??????????

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

    • @dhairyaahuja9498
      @dhairyaahuja9498 3 роки тому

      We can't do it direct coz there is a chance pattern can contain '*' in which case we have to check dp[i+1][n] value (treating * as a null)

  • @ayushgoel9584
    @ayushgoel9584 4 роки тому

    Sir college ke final year exams aa gye , 2 hafte ka break lena padega, ds ke alawa kuch aur karne ka man hi nhi karta, nevertheless will resume learning after 2 weeks.

    • @Pepcoding
      @Pepcoding  4 роки тому +4

      College padhne nahi deta.

    • @jay-rathod-01
      @jay-rathod-01 4 роки тому

      @@Pepcoding Facts

    • @shang_chi4651
      @shang_chi4651 3 роки тому

      @@Pepcoding pata nhi sir curriculum kyun banaya gaya hai, jab ds algo, os, oops aur dbms hi important hai to electronics je subjects kyun padhate hain.🙄

    • @jobanpreetsingh2370
      @jobanpreetsingh2370 2 роки тому

      @@shang_chi4651 electronics? That's shit subject 1001 blah blah

  • @ujjwaljain9780
    @ujjwaljain9780 3 роки тому

    Sir I want to make some java library as an some mini project for e.g to create your own library for Linked list or graph or any data structure .
    Pls help sir ho sake to ek video bna do sir Esme kyoki bahut kaam time me ek decent project bn skta hai resume ke liye ya ......
    Pls reply sir

  • @uditrohila4282
    @uditrohila4282 4 роки тому

    Sir I am 2020 passout . Want to get job in product based company . Is their course which I join to get good job..

    • @Pepcoding
      @Pepcoding  4 роки тому

      yes, try our levelup or IP course. contact 01140194461.

    • @uditrohila4282
      @uditrohila4282 4 роки тому

      @@Pepcoding sir one question in product based 12 class percentage matters a lot or only required btech cgpa..