Count Distinct Palindromic Subsequences Dynamic Programming | Leetcode Hard Solution

Поділитися
Вставка
  • Опубліковано 12 вер 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 Count Distinct Palindromic Subsequences problem using dynamic programming. In this problem,
    1. You are given a string.
    2. You have to print the count of distinct and non-empty palindromic subsequences in the given string.
    3. Two sequences s1 and s2 are distinct if here is some i, for which ith character in s1 and s2 are different.
    Note - String contains only lowercase letters.
    - The answer will be in the integer range only.
    To submit this question, click here: www.pepcoding....
    For a better experience and more exercises, VISIT: www.pepcoding....
    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

КОМЕНТАРІ • 165

  • @debanjandas1378
    @debanjandas1378 Місяць тому

    Amazing video!!!! Thank you so much for such a detailed explanation!!!

  • @LakshmanTiwari-sd7nk
    @LakshmanTiwari-sd7nk Рік тому +1

    Best Explanation.

  • @saurabh.gupta22
    @saurabh.gupta22 Місяць тому

    Literally great detailed Insightful video of deriving the formula , Loved it♥

  • @akshatgoel149
    @akshatgoel149 29 днів тому

    GAWD effort.... Respect

  • @tusharjha2150
    @tusharjha2150 4 роки тому +84

    Tysm.
    Taking out 100 minutes to on a single question to develop insight, requires extreme dedication. Thank you so much for that

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

      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 my efforts, I request a review
      g.page/Pepcoding/review?rc

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

      @@Pepcoding I have given the review sir cuz video is superb understood the insight watched whole video

  • @silentrain9789
    @silentrain9789 4 роки тому +31

    Was better than Watching a Movie.

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

      I am grateful you took out time to watch it

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

    Just amazing

  • @pranjalgusain21
    @pranjalgusain21 Рік тому +4

    I hit like as soon as his tshirt color changed at 38:00 , he dedicated two days to explain this problem in the best and clear way possible! Hats off to you sir!

  • @hymnish_you
    @hymnish_you 3 роки тому +5

    Learnt Concept + Allegiance + Dedication.
    Thanks to the best DS Algo teacher.

    • @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, we request a review - g.page/Pepcoding/review?rc

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

      @@Pepcoding 404 error, Sir

  • @dassatyajit2001
    @dassatyajit2001 2 роки тому +6

    @Pepcoding team. What great materials you have published . @Sumeet hats off to your dedication and superhuman patience. 1hr 40 mins to explain and clarify a single question that is out of this world. No channel can come close to yours with the the level of details and reasoning you provide behind the solutions . I can't thank you enough.

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

    Not a single second of such a long video was boring! Thanks a lot❤

  • @Raviranjankumar761
    @Raviranjankumar761 Рік тому +1

    Thanks a lot @PrepCoding for this phenomanal material, This is something will change the attitude with which we solve our problem. Wonderful postmartum of the probelm.

  • @er.shivamkesarwani6668
    @er.shivamkesarwani6668 3 роки тому +11

    Sir ,we want more solutions and concepts for difficult problems, you are best

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

    Took me around 2hrs+ to grasp everything, thank you so much for the video Sir

  • @AnkitKumar-xc8rv
    @AnkitKumar-xc8rv 3 роки тому +6

    This is one of the longest video I have ever seen on pepcoding channel, but I must tell that this is the best explanation video for the problem I walk through most of the videos on UA-cam. I have seen this video twice, though its long but its very important to learn the maths behind the problems rather than just remembering it without understanding.
    Thank You #Sumeet_Malik for providing such a wonderful explanation video. #We_Need_More_Videos_Like_This

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

    watched it till end. What an effort you make!!!!!!!!!!!!!!!!! really appreciated. Just dont stop ever.

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

      mza aya na? koi maths ka shokeen dekhega to usko bhot feel aaegi, sirf formula btana asaan tha, full analysis mushkil. isme bhi last ke 2 cases poora mathematically rigorous analysis nahi kia. wo aur hota to aur mza ata.

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

      @@Pepcoding haan but jitna bhi analysis kiya usme bada mazza aaya. Nayi chiz sikhne ko mili. Isme toh distinct palindromic subsequences batane the. Ye video dekhne ke baad mujhe ek sawal mila jisme palindromic subsequences btane the irrespective of ki vo distinct h yaa nhi. Iss concept se ye sawal bhi ban gaya. Tysm.

  • @omkeshvarshney8957
    @omkeshvarshney8957 3 роки тому +6

    A big big thanks and shout out to you sir..You made it easy to understand DP and just because of your content i'm able to crack HCL and TCS Internviews for FTE

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

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

      Sure sir, I will.

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

    There are people who just want to know the technique and code and thats the best part of this video. It caters to all the audiences who wants just the answer and the deeper insight. Love it.

  • @ritiktwopointo2691
    @ritiktwopointo2691 3 роки тому +6

    ufff, thats some next level dedication sir, completed it today. tysm sir :)

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

    Every second of the video was worth watching 🔥

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

      is video ko to koi jhel leta hai to mai grateful feel karta hun

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

    best explanation , no one will explain so well free of cost for so much time...thanq so much!!!!!!!!!!

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

    When I saw video is of 100 minutes, I knew , dekhna Hi padega . Thank you for your efforts !

  • @MGtvMusic
    @MGtvMusic 2 роки тому +2

    Amazing explanation!
    Watched it along with my own attempt in around 3 hours
    Now the concept is crystal clear

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

      Great to hear!
      Keep learning.
      And for better experience and well organised content visit nados.pepcoding.com

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

    Watched the full video. Thanks for the insight

  • @mohdashraf3903
    @mohdashraf3903 4 роки тому +8

    Interesting video with the best explanation as always. I watched the full video !! Thank you, sir.

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

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

    Ek hai curriculum ki discrete mathematics 😂jo mujhe lagta tha ki kyun hi padhate hain kyunki koi use to dikhta nhi tha coding ques mein,jabse advanced dp start ki hai sumeet sir me bhar bhar ke set theory ke proofs samjha diye. Hats off to you sir, legendary content🙏

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

      If you like the content could you post something on LinkedIn about us? This will help us in reaching out to more people and help a lot of other students as well
      Something like this
      Sumeet Malik from Pepcoding is making all his content freely available to the community
      You can check it out here - www.pepcoding.com/resources
      /
      Also, this is the youtube channel - ua-cam.com/users/Pepcodingplaylists?view_as=subscriber

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

    everybody gangsta in finding count of all palindromic subsequences until the interviewer mentions "distinct"

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

      Everybody is a gangsta until you have to see a video of 1 hour 40 minutes for one question

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

      @@Pepcoding lmao

  • @singhnav232
    @singhnav232 4 роки тому +9

    Other coding institutes dont have such reasoning in their dynamic programming course content, they just tell how and what, not why.

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

      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 my efforts, I request a review
      g.page/Pepcoding/review?rc

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

      @@Pepcoding done

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

    35/79 Done

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

    there are many youtube coding channel which i know but only on your channel i get this question as its difficult to explain,all other channels just covered its med variation that is no. of subsequence in string but pick this up great sir,love the way to teach🧡🧡🧡

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

    you deserve a lot more recognition . (#rising star)

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

      watched this video till end.... and now i can explain with the same confidence as you did.

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

    One of the best explanation. Thanks a lot sir.

  • @shubhamraj25
    @shubhamraj25 Рік тому +1

    C++ Solution for LeetCode
    class Solution {
    public:
    int countPalindromicSubsequences(string s) {
    int n = s.length();
    unordered_map m;
    int prev[n];
    int next[n];
    int modulo = 1000000007;

    for(int i = 0; i < n; ++i) {
    if(m.find(s[i]) != m.end()) {
    prev[i] = m[s[i]];
    }
    else {
    prev[i] = -1;
    }
    m[s[i]] = i;
    }

    m.clear();
    for(int i = n - 1; i >= 0; --i) {
    if(m.find(s[i]) != m.end()) {
    next[i] = m[s[i]];
    }
    else {
    next[i] = -1;
    }
    m[s[i]] = i;
    }

    vector dp(n, vector(n));

    for(int g = 0; g < n; ++g) {

    for(int i = 0, j = g; j < n; ++i, ++j) {
    if(g == 0) {
    dp[i][j] = 1;
    }
    else if(g == 1) {
    dp[i][j] = 2;
    }
    else {
    if(s[i] != s[j]) {
    dp[i][j] = (dp[i][j - 1]%modulo + dp[i + 1][j]%modulo - dp[i + 1][j - 1]%modulo)%modulo;
    }

    else {
    int n = next[i];
    int p = prev[j];

    if(n == p) {
    dp[i][j] = (2*dp[i + 1][j - 1] + 1)%modulo;
    }
    else if(n < p) {
    dp[i][j] =((2*dp[i + 1][j - 1])%modulo - (dp[n + 1][p - 1])%modulo)%modulo;
    }
    else {
    dp[i][j] = (2*dp[i + 1][j - 1] + 2)%modulo;
    }
    }
    }
    if(dp[i][j] < 0)
    dp[i][j] += modulo;
    }
    }

    return dp[0][n - 1];
    }
    };

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

    Aapke mehnat ko salam🙏

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

    You are legend sir! God bless you!

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

      Thank you so much 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 )

    • @JT-pq1ey
      @JT-pq1ey 3 роки тому

      Are you from DAIICT Aditya ?

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

      @@JT-pq1ey Nope, Jaypee Nodia

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

    amazing explanation sir ... really hats off sir 💖

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

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

  • @Hephaestus-q9h
    @Hephaestus-q9h Рік тому

    is this question part of some playlist?

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

    only 338 out of 367 test cases passig on leetcode :(

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

      see my latest comment on this video

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

    Hi Sumit. Thanks for your videos . Its because of your videos i got offer from SAP. God bless you

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

      I'm glad to know that and many congratulations to you. I wish for lots of more succes in your life.😊
      Can you DM me on LinkedIn?

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

    ❤️❤️Superb explanation 👍😀..

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

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

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

    Dil khush kar diya aisa kisine nahi samjhaya hai 😌😭🤧🤧🤧

  • @VIJAYKUMAR-tn1kr
    @VIJAYKUMAR-tn1kr 3 роки тому

    Thank a lot sir .

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

    sir nados ki site pe ek bhi video ni chlri kl se try kr ra hun

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

    Awesome teacher...

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

    God this was bloody awesome. Thank you so much.

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

      Iss shehar Mei swag hai mera bhai. Hapy new year to you. Analysis dekh rhe ho? Deep hai na?

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

      @@Pepcoding Happy New year to you too.

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

      @@Pepcoding Absolutely I have never see this depth of analysis anywhere.

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

    sir can you tell us which maths topics are must for us to do well in these questions..
    if possible can you please recommend any good resources on that.

  • @336_saranyamaity8
    @336_saranyamaity8 3 роки тому

    GOD TEACHER OR WHAT ❤️‍🔥

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

    Sir ,badi video pe b views ki kami nahi this proves that students are dedicated like you as well,same views ha

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

      Ji..
      Keep watching and keep learning😊

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

    Sir in this let's say tha string is abaaca then the next and prev will be 2 and 3 for I=0 and j=5 , so there is no middle part for next and prev but in your code it will ask for dp[n+1][p-1] which will turn out to be dp[3][2] which is invalid so I think you should add a case when p==n+1 , your code will run even without this case because dp[3][2] will be zero (default value is 0 in java ig) but it is good to acknowledge this because in c++ there can be garbage value.

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

      For better insight, visit nados.pepcoding.com, post your doubts, community will help you out there.

  • @KB-zg8ho
    @KB-zg8ho 3 роки тому

    Sir last mai bikul sahi baat booli aapne great video maja aa gya

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

      kya aap full dekh paae? mujhe 2 din lage ye bnane mei, isko indepth samjhne mei.

    • @KB-zg8ho
      @KB-zg8ho 3 роки тому

      @@Pepcoding sir not in 1 sitting but dekh le abb dubara dekhne padega for more better understanding

    • @KB-zg8ho
      @KB-zg8ho 3 роки тому

      @@Pepcoding sir jab maths coding mai aa jaati hai uska alag swaad aata hai

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

    Finally sir I have gathered motivation to watch this 1 hr 40 mins long video😅

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

    east ho ya west sumeet sir is the best

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

      keep motivating, keep learning and keep loving Pepcoding😊

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

    Bhaiya, thanks a lot, for in depth analysis,
    small request: Level up me DP ke lectures, proper order me sorted nahi he, dependency wise,
    matric multiplication is kept before it's dependent and same for next 5-6 lectures.

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

    Sir puri video deki.... Its worth it !!!

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

    Wow explanation hai sir. Thank You!!!

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

      I hope you watched it completely.

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

      @@Pepcoding Haanji complete dekhi Sir

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

    We have to add this line after the final if else case in line 63 ,
    to avoid negative answer due to very large numbers.
    // when number is very large , it could overflow and change from a large positive number to
    // negative number , that's why are taking mod of 1000000007 everytime to keep it in this range
    // for negative case and very big numbers
    dp[i][j] = dp[i][j] < 0 ? dp[i][j] + 1000000007 : dp[i][j] % 1000000007;

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

    aise hi question ke liye open kri thi video length dekh kr hi moral down hogya ni to me at least 30 mint tk to approach sochta hi hu or ho bhi jata hai kaafi ya pura but isme hmmt si nhi hui sidha puri video hi dekhna shuru krdi.
    btw Sir great efforts for recording it. Thank you so much again .

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

      I hope aapne poora dekha aur sab kuch samjha

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

      @@Pepcoding just abhi complete kri hai video do part me dekhi first part me what,how or second part abhi dekh hai . bdhia insight bn gyi Inclusive Exclusice Principle pr based hai proof.

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

    sir please apne videos par ads ON kar lo

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

    The best video till date, so much effort and care showing in the explanation, Loved it sir. keep going!!

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

      mza aya na? Kya aap end tak dekh paai?

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

      @@Pepcoding Yesss bahut amazing tha

  • @priyanshu-1922
    @priyanshu-1922 2 роки тому

    Damn what a deep explanation sir
    🙌🙌 hats off to uh

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

    thanks a lot sir for your hardwork. is there any possibility for english lectures in the future?

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

      not in near future but next year mid, i will try

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

    Lost you at 1:16:00 ? How is s4 and s1 both x? isnt s4 something like a(x)? Also how is 2x+a+aa = 2x+2?

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

      (a + aa) are two distinct count and same for s1 for s4

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

      @pepcoding please reply?

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

    Pichhla question bohot sahi samjhaya tha
    to usi ki wajah se iska why khud hi figure out kar liya

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

    Sir, haven't watched it yet. But will watch for sure, when I'll start DP.

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

      Best of luck

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

      @@Pepcoding Sure Sir. Just keep blessing us with your super content.

  • @2121sourabh
    @2121sourabh 3 роки тому

    superb explanation 100mins spent right 🤩

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

  • @Phoenix-xi2gy
    @Phoenix-xi2gy 4 роки тому +1

    Sir, agr ye last k 2 formulae hum interview me bhi aise hi btade to chlega na?

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

    I was so close to banging my head then i remembered Sumeet bhaiya!!!

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

      Haha...keep remembering like this.😋

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

    Are u kidding me bs ek question ke liye almost 2 hr ki video 😂😂

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

    nice explanation

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

    In the last case where there is two "a" in between the string. How the set s4 is converted to s1? Because after deletion of aa from s4 there is still "a" present at the first and last position of the string present in set s4

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

      For better experience and precisely arranged content you can visit on nados.io, even you can resolve all your doubts by posting all your doubts on community tab of NADOS.

  • @AryanSingh-gk2hi
    @AryanSingh-gk2hi 3 роки тому +1

    is it just me or the medium level questions are the real hard questions.

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

      yes they really are ,if you haven't done your revision well ( means you hadn't understood some similar questions beforehand ) , then it's too difficult to think on the time of coding round

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

      @@mickyman753 Revison well then it is hard or easy to think on coding round?

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

      @@KejriwalBhakt missed a "haven't"

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

      @@KejriwalBhakt easy ofc

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

    Maza a gaya🔥👌

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

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

    Sir dp on trees and burst balloons wale problems also

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

      Burst baloon aj dalega. DP on trees to trees ke sath aaega.

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

    FIRST VIDEO I HAVE SEEN WITH 0 DISLIKES :))

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

      Many more you'll get to see like this😋
      Keep learning and keep loving Pepcoding!😊

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

      Now it's 3 dislike

  • @037_sayedramishali7
    @037_sayedramishali7 4 роки тому +2

    Sir rank list dalvadijea site par🙏🙏

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

    How to figure out the cases - equality and inequality

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

    Sir one more thing i want to know will dsa course on your website will come on UA-cam?

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

      yes all the dsa paid courses will be made free on youtube. it is taking some time. oct 30 is my deadline.

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

      @@Pepcoding u r doing great service to the students . May god bless u always

  • @rahulsingh-lv5xp
    @rahulsingh-lv5xp 4 роки тому +1

    sir banye badi video dekhne ke liya hum hai

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

      I hope aapne poori dekhi

  • @username-tg7if
    @username-tg7if 3 роки тому

    sir its giving negative result if string size becomes large

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

      answer integer range ke bahar jaa raha hoga

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

    Sir how to explain it in interview?

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

    sir online round k liye bhi pepcoding or leetcode sahi hai ya fir uske liye cp krni hogi

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

      level2 of pepcoding will be enough except for a few companies (tower research, codenation etc.)

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

    sir your code failed for this string "aaaa" on Leetcode (Expected answer : 4 distinct palindromes , but it gives us '2').
    when extremes are same and 2'a are also present but m' - middle part not present.
    In this case next[i] > prev[j] .... so dp[next[i] +1][prev[j] - 1] (i.e lower triangular value) has garbage value.... which shows error.
    Just slight modification
    // 2*middle part - m'
    //dp[i][j] = 2*dp[i+1][j-1] - dp[next[i] + 1][prev[j] - 1];
    int a = 2*dp[i+1][j-1];
    if(next[i]+1

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

    Sir ek question baacha hai list me please vo sbse phele complete kra do *Min Squares* wala.

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

      wo to done hai. playlist mei video hai uski. LIS jaisa hai.

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

    great job on proving the equation, but mujhe lagta hai no one can come up with this in an interview. Agar dekh bhi liya to bhi samjhana interviewer ko bahot mushik hai.

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

      keep motivating, keep learning and keep loving Pepcoding😊

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

      ye bs coding round mat aah skta hai with some language change as a hard question

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

    Patth gyi, par dard ache h

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

      arey arey!! tum isse strong ho

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

    Kudos ! Great Job!

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

    you need to watch this twice to understand it completely !!

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

    Sir c++ mein kyu nhi daalte aap solution sirf java kyu sir :( :( Sir aap bhot accha pdhate ho

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

      beta iska solution nikal rhe hain

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

      Java and C++ are almost identical at least from DSA point of view.