Longest valid parentheses | 3 approaches to this wonderful problem Love Babbar DSA sheet

Sdílet
Vložit
  • čas přidán 26. 07. 2024
  • If you wish to donate to the channel:
    Google pay UPI ID: adimantheboss123@okaxis
    -------------------------------------------------------------------------------------------------------------------------
    Problems:
    1. valid parentheses:
    practice.geeksforgeeks.org/pr...
    solution:
    practice.geeksforgeeks.org/vi...
    leetcode:
    longest valid parentheses:
    leetcode.com/problems/longest...
    solution:
    stack:
    ideone.com/knonZ0
    O(1 )space solution:
    ideone.com/EiQk9k
    -------------------------------------------------------------------------------------------------------------------------
    Playlist link:
    • 450 questions DSA sheet
    Link to the questions:
    drive.google.com/file/d/1FMdN...
    Connect with me on Linked in:
    / aditya-rajiv-0606491a5
    Connect with me on Instagram:
    / adi_rajiv
    #lovebabbardsasheet #stacks #postfixevaluaton #gfg #Coding #Fun #SDE #Placement #competitiveprogramming

Komentáře • 31

  • @vinaykumarkhardoniya9639
    @vinaykumarkhardoniya9639 Před 2 lety +3

    All three approaches explained nicely👏👏

  • @03_abhishekchoubey42
    @03_abhishekchoubey42 Před 2 lety +3

    Bhai bhot aacha samjaya aapne full effort absolutely appreciable

    • @adityarajiv6346
      @adityarajiv6346  Před 2 lety +1

      Glad it helped you😀. Please share the channel with all your friends and subscribe 😀🙏.

  • @akshayrahangdale8511
    @akshayrahangdale8511 Před 11 měsíci

    Loved Your Ezplanation of all 3 approaches

  • @tanzeelahmed2055
    @tanzeelahmed2055 Před 2 lety +1

    Very well explanation

  • @sanjanamondal1894
    @sanjanamondal1894 Před rokem +1

    superb explanation

  • @vedantsati985
    @vedantsati985 Před 3 lety +2

    greatly explained

    • @adityarajiv6346
      @adityarajiv6346  Před 3 lety +1

      I'm happy it helped you😀.
      Please share the channel with all your friends and subscribe 😀🙏.

    • @vedantsati985
      @vedantsati985 Před 3 lety +2

      @@adityarajiv6346 done sir

  • @MrChetan54
    @MrChetan54 Před 2 lety +3

    Nicely explained 3 approaches. I guess there's a DP approach too. Most YT videos aren't showing it.

  • @surya.maheshkolisetty1997
    @surya.maheshkolisetty1997 Před 11 měsíci

    Greatttt

  • @ROHITSHARMA-te2zo
    @ROHITSHARMA-te2zo Před 2 lety +1

    i understood it here ;)

  • @divyanihirulkar6868
    @divyanihirulkar6868 Před 2 lety +4

    well explained. i am not able to approach problems and most of the time ending up watching solutions on yt is it ok ?? plz tell

    • @adityarajiv6346
      @adityarajiv6346  Před 2 lety +9

      It's alright. Just keep revising those problems which you are not able to solve.
      When you try a new question, try to find some patterns from your previous experience.

  • @ahn360
    @ahn360 Před rokem +2

    Bhaiya DSA question solve nahi ho pata Aapse to kya karte the please reply bhaiya

  • @MilindGupta
    @MilindGupta Před 3 lety +1

    your leetcode submission is not showing since personal submission doesnt shows to others , so i u want to share next post it in the discussion tab

    • @adityarajiv6346
      @adityarajiv6346  Před 3 lety

      Okay i shall change this!. Thanks for letting me know!.

  • @frustated_fool
    @frustated_fool Před 3 lety +1

    i have an approach using one stack and prefix sum . passed in leetcode

    • @adityarajiv6346
      @adityarajiv6346  Před 3 lety +1

      yes please share here others can also see

    • @frustated_fool
      @frustated_fool Před 3 lety +3

      @@adityarajiv6346 its not prefix sum exactly but a intuition of it.
      int longestValidParentheses(string s)
      {
      int n = s.length();
      if(n < 2) return 0;
      stack st;
      vector v(n , false);

      // mark those indices in the string which is a part of valid parantheses
      for(int i=0;i

  • @isms-7
    @isms-7 Před 3 lety +3

    How u learned DSA? Recommend any course for me

    • @adityarajiv6346
      @adityarajiv6346  Před 3 lety +2

      I learned through self study only. There are lot of youtube videos available. Are you comfortable in english or hindi?

    • @isms-7
      @isms-7 Před 3 lety +2

      @@adityarajiv6346 I am comfortable with english bro ...can u tell me through which yt channel or courses u can able to solve all these questions?

    • @adityarajiv6346
      @adityarajiv6346  Před 3 lety +2

      first of all start from gfg practice problems because over there its given topic wise and difficulty wise.
      Then you can do leetcode. If you get stuck ...just search on youtube , somone would have made a video on that question....maybe me only!.
      Thats how i have been learning.

    • @isms-7
      @isms-7 Před 3 lety +2

      @@adityarajiv6346 thank u bro. Keep doing ur work it's useful for others as well as for u.

    • @adityarajiv6346
      @adityarajiv6346  Před 3 lety +3

      @@isms-7 yes I'm happy to help😀.
      Please share the channel with all your friends and subscribe 😀🙏.

  • @whylifts
    @whylifts Před 3 lety +1

    these 4 questions are same, can be solved with one approach : czcams.com/video/ic8JTuVckg0/video.html, hope this helps.