Longest valid parentheses | 3 approaches to this wonderful problem Love Babbar DSA sheet
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
All three approaches explained nicely👏👏
Bhai bhot aacha samjaya aapne full effort absolutely appreciable
Glad it helped you😀. Please share the channel with all your friends and subscribe 😀🙏.
Loved Your Ezplanation of all 3 approaches
Very well explanation
superb explanation
Thanks for liking
greatly explained
I'm happy it helped you😀.
Please share the channel with all your friends and subscribe 😀🙏.
@@adityarajiv6346 done sir
Nicely explained 3 approaches. I guess there's a DP approach too. Most YT videos aren't showing it.
Glad it was helpful!
Greatttt
i understood it here ;)
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
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.
Bhaiya DSA question solve nahi ho pata Aapse to kya karte the please reply bhaiya
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
Okay i shall change this!. Thanks for letting me know!.
i have an approach using one stack and prefix sum . passed in leetcode
yes please share here others can also see
@@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
How u learned DSA? Recommend any course for me
I learned through self study only. There are lot of youtube videos available. Are you comfortable in english or hindi?
@@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?
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.
@@adityarajiv6346 thank u bro. Keep doing ur work it's useful for others as well as for u.
@@isms-7 yes I'm happy to help😀.
Please share the channel with all your friends and subscribe 😀🙏.
these 4 questions are same, can be solved with one approach : czcams.com/video/ic8JTuVckg0/video.html, hope this helps.