Valid parenthesis string | Leetcode

  Рет қаралды 52,782

Techdose

Techdose

Күн бұрын

This video explains a very important stack interview coding problem which is to find if a given string is valid or invalid in terms of parenthesis. This question is slightly twisted because it has stars in it as well which can be converted to ( or ) or and empty string. I have explained the solution using two stacks which is one of the optimal solution running in linear time O(N). As usual, CODE LINK is given below. If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful...CYA :)
CODE LINK: gist.github.co...

Пікірлер: 223
@meetnikhil719
@meetnikhil719 4 жыл бұрын
That moment when I heard the position of the * is important. Hats off!!
@techdose4u
@techdose4u 4 жыл бұрын
Thanks :)
@meetnikhil719
@meetnikhil719 4 жыл бұрын
@@techdose4u no, Thank you!!
@rishabhkumar8029
@rishabhkumar8029 8 ай бұрын
Really very good explanation
@TheMOM00000
@TheMOM00000 2 жыл бұрын
GENIUS. Better than all solutions on leetcode, especially the one posted by them.
@techdose4u
@techdose4u 2 жыл бұрын
Thanks ☺️
@gautamthakur8581
@gautamthakur8581 8 ай бұрын
Its been 3 years of posting the solution ,, still it is the best
@ankurgupta4696
@ankurgupta4696 4 жыл бұрын
The moment you said that positions are important i understood the concept and coded your concept without even watching full video thanks for your awesome vidoes.....
@techdose4u
@techdose4u 4 жыл бұрын
😂Nice :)
@akshatjain6854
@akshatjain6854 4 жыл бұрын
Thanks Bro. I was able to pass 28 test cases out of 50 in Leetcode . The main thing which was frustrating me was how to deal with positions. You made it very simple .
@techdose4u
@techdose4u 4 жыл бұрын
I am happy that you tried to solve yourself :)
@abishekbaiju1705
@abishekbaiju1705 6 ай бұрын
After a lot of time I kind of came close on how to solve this. I tried solutions from neetcode, leetcode. but none of them were making sense. but your solution was so so clear. Thanks a lot. I was able to code the solution by myself.
@techdose4u
@techdose4u 6 ай бұрын
Nice :)
@uthrakaruna999
@uthrakaruna999 8 ай бұрын
it's a great explanation and solution , here is the same approach in python (if any one needs) class Solution: def checkValidString(self, s: str) -> bool: opens=[] stars=[] for i in range(len(s)): if s[i]=="(": opens.append(i) elif s[i]==")": if opens: opens.pop() elif stars: stars.pop() else: return False else: stars.append(i) # if open is not empty then it is not balanced if opens: for i in range(len(opens)-1,-1,-1): if not stars or stars.pop()
@prajwal9610
@prajwal9610 4 жыл бұрын
That was an excellent explanation of this problem. Thanks for giving examples for all the cases.
@techdose4u
@techdose4u 4 жыл бұрын
Thanks :)
@praveengautam4689
@praveengautam4689 2 жыл бұрын
genius approach of using stacks
@stith_pragya
@stith_pragya Жыл бұрын
Thank You So Much for this wonderful video..........🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
@nandpatel924
@nandpatel924 4 жыл бұрын
100 percent faster, my god i was shocked , really shocked
@techdose4u
@techdose4u 4 жыл бұрын
😅
@sridharbattala3077
@sridharbattala3077 2 жыл бұрын
This is awesome explanation, even leetcode also doesn't have explanation like this
@vani3986
@vani3986 8 ай бұрын
Great explanation with best solution
@traton3063
@traton3063 4 жыл бұрын
thanks for another concise and insightful video. I appreciate the fact that you carefully went through the questions and explain the approach with clear details. Also, quickly go through the code like what you did is perfect because the key is the approach and the algorithm for the problem. Great work! Looking forward to seeing more videos from you buddy!
@techdose4u
@techdose4u 4 жыл бұрын
Thanks :)
@molyoxide8358
@molyoxide8358 Жыл бұрын
You've made this question clear with enough examples than leetcode. thanks for that.
@ehsona1827
@ehsona1827 4 жыл бұрын
explanation is top notch, I have solved a similar problem to this problem. The best solution I've come up with is by doing 2 linear passes from left side and then from right side. O(n) time, O(1) space.
@techdose4u
@techdose4u 4 жыл бұрын
Nice....can you please share your code here?
@surbhi191
@surbhi191 4 жыл бұрын
@@techdose4u int count = 0; for(int i = 0; i=0; i--){ char c = s.charAt(i); if(c==')' || c=='*') count++; else{ if(count==0) return false; count--; } } return true;
@RV-qf1iz
@RV-qf1iz 2 жыл бұрын
7:56 new word in the dictionary. Well Explained
@thakuranujbhati1565
@thakuranujbhati1565 8 ай бұрын
Such a master of explanation ❤❤ that any one can easily understand the problem
@crimsoncad3230
@crimsoncad3230 4 жыл бұрын
1 optimization can be done here. After processing closing brackets if len(openStack) > len(star): Return False Else Process openStack from right to left
@techdose4u
@techdose4u 4 жыл бұрын
I think finding the length will again take O(N) if starts counting the element. But if counting takes O(1) than its good. Glad that you noticed. I saw it while editing 😅
@crimsoncad3230
@crimsoncad3230 4 жыл бұрын
@@techdose4uDon't know about other languages but in Python the time complexity to find the length of a list(in this case stack) is O(1). So this optimization can be beneficial.
@crimsoncad3230
@crimsoncad3230 4 жыл бұрын
@@techdose4u We can also have a counter that manages the count of element in the stack after every push and pop operation.
@techdose4u
@techdose4u 4 жыл бұрын
Yea.....it will be great :)
@techdose4u
@techdose4u 4 жыл бұрын
This sounds better :) Works for all languages ;)
@yitingg7942
@yitingg7942 3 жыл бұрын
Yeah!!! Got another right following your video Sir. You just make everything that had been haunting me to go away so easily. Thank god that you are here with me!!
@techdose4u
@techdose4u 3 жыл бұрын
❤️ Keep going
@TheLaidia
@TheLaidia 3 жыл бұрын
THANK YOU!! You make this problem a lot easier
@techdose4u
@techdose4u 3 жыл бұрын
Welcome
@bfoot239
@bfoot239 Жыл бұрын
Great job man! This solution is much clear and even better for me to understand the problem than the leetcode editorial solutions
@nabinkumarshaw4474
@nabinkumarshaw4474 8 ай бұрын
easy and better nice explaination
@darkexodus6404
@darkexodus6404 Жыл бұрын
Very articulately explained! Thank you!!
@amiransari1974
@amiransari1974 4 жыл бұрын
this video is very much helpful to understand the problem, Thanks
@techdose4u
@techdose4u 4 жыл бұрын
Welcome :)
@25691331
@25691331 4 жыл бұрын
Great Resource and great solution.
@techdose4u
@techdose4u 4 жыл бұрын
Thanks :)
@ris_colid325
@ris_colid325 Жыл бұрын
Any intuition for the greedy approach?
@ajy7867
@ajy7867 8 ай бұрын
Loved your explanation
@anshumansinghrajawat7242
@anshumansinghrajawat7242 3 жыл бұрын
Nice explanation brother , keep uploading leetcode videos as much as possible
@ambujverma9287
@ambujverma9287 4 жыл бұрын
very good explanation .... thank you
@techdose4u
@techdose4u 4 жыл бұрын
Welcome :)
@ianpan0102
@ianpan0102 4 жыл бұрын
Great detailed solution! Except I have one minor issue: From around 5:00 - 5:20, we are trying to balance out the last closing parenthesis at position 6. We see that open_stack is empty, so we aim for the star_stack. According to your explanation, we would pop the star at index 4 to be converted to an open parenthesis and match it with closing parenthesis #6. But intuitively when looking at the string, we should have used the star at index 0 as an open parenthesis for closing paren #6 -- because the star at index 4 should really be a opening match for the closing parenthesis at index 5. Doesn't this matter?
@techdose4u
@techdose4u 4 жыл бұрын
Actually think the other way. I said the last star is popped to match current closing bracket because you convert last star to opening bracket and ignore other brackets, the entire parenthis gets balanced. I said that meaning to take care of current imbalance due to an extra closing bracket. This doesn't mean that inner bracket will balance outer bracket. I hope you got it :)
@ianpan0102
@ianpan0102 4 жыл бұрын
@@techdose4u I think I got it. Btw, I came across another method that keeps track of the balance and loop through left to right then right to left. Time complexity is O(2n) = O(n). Here's a sample C++ code I wrote, thought you'd be interested: """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" class Solution { public: bool checkValidString(string s) { int n = (int)s.length(); int bal = 0; // keep track of balance for (int i = 0; i < n; ++i) { if (s[i] == '(' || s[i] == '*') { bal++; } else { bal--; if (bal < 0) return false; } } bal = 0; // keep track of balance for (int i = n - 1; i >= 0; --i) { if (s[i] == ')' || s[i] == '*') { bal++; } else { bal--; if (bal < 0) return false; } } return true; } }; """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@techdose4u
@techdose4u 4 жыл бұрын
Nice...thanks
@RaviYadav-xg2hy
@RaviYadav-xg2hy 4 жыл бұрын
Great explanation and approach made it so easy problem !!
@techdose4u
@techdose4u 4 жыл бұрын
Thanks :)
@ashwanikumar4288
@ashwanikumar4288 3 жыл бұрын
Nice work! Have you covered the O(1) space solution as well in any other video?
@azeezsayyad7281
@azeezsayyad7281 4 жыл бұрын
thanks bro u deserve lot more subscribers
@techdose4u
@techdose4u 4 жыл бұрын
Thanks bro :)
@ishikajaiswal4735
@ishikajaiswal4735 Жыл бұрын
thankyou so much! crisp explanation.
@arijitdey8419
@arijitdey8419 3 жыл бұрын
Great explaination..Thanks a ton sir
@techdose4u
@techdose4u 3 жыл бұрын
Welcome
@chenghuilee6982
@chenghuilee6982 4 жыл бұрын
Thank you sir! Very detailed explanation. You deserve more subs .
@techdose4u
@techdose4u 4 жыл бұрын
Thanks :)
@chandrasekharpatra2416
@chandrasekharpatra2416 4 жыл бұрын
Thank you finally someone explained it better.
@techdose4u
@techdose4u 4 жыл бұрын
Welcome :)
@tumul1474
@tumul1474 4 жыл бұрын
awesome dude !! you make amazing tutorials
@techdose4u
@techdose4u 4 жыл бұрын
Thanks :)
@harifrahman8054
@harifrahman8054 4 жыл бұрын
Nice explaination
@techdose4u
@techdose4u 4 жыл бұрын
Thanks :)
@krishnavamsichinnapareddy
@krishnavamsichinnapareddy Жыл бұрын
Superb explanation ❤
@ashvinkumhar5819
@ashvinkumhar5819 2 жыл бұрын
Thanks bro your explaination is very great.
@rhondawang2639
@rhondawang2639 3 жыл бұрын
so smart, very clear thank u
@techdose4u
@techdose4u 3 жыл бұрын
Welcome
@TheKarateKidd
@TheKarateKidd 3 жыл бұрын
Great and clear explanation. Thank you!
@techdose4u
@techdose4u 3 жыл бұрын
Welcome
@satyanarayanmohanty3415
@satyanarayanmohanty3415 4 жыл бұрын
Brilliant explanation. Thanks a lot.
@techdose4u
@techdose4u 4 жыл бұрын
Welcome :)
@fullstackacademy8400
@fullstackacademy8400 4 жыл бұрын
Perfect approach
@techdose4u
@techdose4u 4 жыл бұрын
Thanks
@hortsss
@hortsss 4 жыл бұрын
Thanks for your explanation! At first I didn't understand every possibilities the '*' had. And also, would never think about doing it using stacks. Congrats, man!
@techdose4u
@techdose4u 4 жыл бұрын
Thanks :)
@rajatbudania6181
@rajatbudania6181 4 жыл бұрын
Very Well Explained.!
@techdose4u
@techdose4u 4 жыл бұрын
Thanks
@karthikmadan
@karthikmadan 8 ай бұрын
amazing explaination
@pranayraj7938
@pranayraj7938 4 жыл бұрын
Such a good explanation......you deserve more subscribers bro.
@techdose4u
@techdose4u 4 жыл бұрын
Thanks :)
@ramnathan4236
@ramnathan4236 4 жыл бұрын
Thank you Sir.I tried using stack but only few testcases passed.
@techdose4u
@techdose4u 4 жыл бұрын
You must have done mistake somewhere. Recheck.
@mohituniyal3008
@mohituniyal3008 4 жыл бұрын
superb explanation!
@techdose4u
@techdose4u 4 жыл бұрын
Thanks :)
@harifrahman8054
@harifrahman8054 4 жыл бұрын
Will be helpful if u try to explain all the complex problems on leetcode
@techdose4u
@techdose4u 4 жыл бұрын
I picked leetcode just because of this April challenge. I will further include problems from here in future.
@spk9434
@spk9434 4 жыл бұрын
Good job
@techdose4u
@techdose4u 4 жыл бұрын
Thanks
@vishalmishra1937
@vishalmishra1937 4 жыл бұрын
supeerb explanation
@techdose4u
@techdose4u 4 жыл бұрын
Thanks :)
@somyasrivastava6315
@somyasrivastava6315 3 жыл бұрын
What an amazing solution
@manishnegi7926
@manishnegi7926 4 жыл бұрын
thanks brother i was able to pass only 42 test cases. can you please make a video i.e related to how ur coding is too good ? and how u are able to solve the questions.
@techdose4u
@techdose4u 4 жыл бұрын
I will make it later....but for now I am focussing on study material content itself. 😅
@uplsove
@uplsove 4 жыл бұрын
great explanation bro. this helped me a lot to understand this problem. Thank you
@techdose4u
@techdose4u 4 жыл бұрын
Welcome :)
@arjitgautam365
@arjitgautam365 10 ай бұрын
Well explained. Appreciated!!
@rishirajpaulchowdhury4163
@rishirajpaulchowdhury4163 3 жыл бұрын
Brilliant explanation. Thanks!!!
@StockWithSayee
@StockWithSayee Жыл бұрын
Loving your teaching :)))
@piercef7343
@piercef7343 4 жыл бұрын
Fantastic explanation!
@techdose4u
@techdose4u 4 жыл бұрын
Thanks :)
@retrogame3138
@retrogame3138 4 жыл бұрын
Very nice you regularly upload the video soon you have more than 100 k subscriber
@techdose4u
@techdose4u 4 жыл бұрын
Hope it comes true someday 😅
@ujjvalcodes3629
@ujjvalcodes3629 2 жыл бұрын
Wonderful solution!!
@weihua5305
@weihua5305 4 жыл бұрын
Thank you very much
@techdose4u
@techdose4u 4 жыл бұрын
Welcome :)
@subhabera5775
@subhabera5775 4 жыл бұрын
Very good explanation.. earned my subscription
@techdose4u
@techdose4u 4 жыл бұрын
Thanks :)
@ApnaVlogs-tj7do
@ApnaVlogs-tj7do Жыл бұрын
nice explanation
@himanshuchhikara4918
@himanshuchhikara4918 3 жыл бұрын
amazing explanation
@uditagrawal6603
@uditagrawal6603 3 жыл бұрын
I took the greedy approach: public boolean checkValidString(String s) { //Left pass int balance = 0; for(int i = 0; i < s.length(); i++){ if(s.charAt(i) == ')')balance--; else balance++; if(balance < 0)return false; } if(balance == 0)return true; balance = 0; //Right pass for(int i = s.length()-1;i >=0;i--){ if(s.charAt(i) == '(')balance--; else balance++; if(balance < 0)return false; } return true; } Ideology : Left pass : If total sum of ( and * is less then ) then string can never be balanced. Right pass : If total sum of ) and * is less then ( then string can never be balanced.
@mrinmoyhalder7293
@mrinmoyhalder7293 2 жыл бұрын
thanks a lot..is this qsn has been asked in any interview ?
@adityasrinivas8044
@adityasrinivas8044 4 жыл бұрын
Hi Sir , @10:28 , You said that by using Greedy Approach , we can solve this in O(1) extra space . How is this possible ?
@techdose4u
@techdose4u 4 жыл бұрын
The trick for O(1) space is simple. You can easily do it in 2 traversals for better understanding. In first traversal from left to right, balance all closing brackets using opening brackets + stars and 2nd traversal from right left, balance all opening brackets using stars and closing brackets already seen :)
@sumengwang8918
@sumengwang8918 4 жыл бұрын
Very helpful, Thank you very much!
@techdose4u
@techdose4u 4 жыл бұрын
Welcome :)
@borat_trades2860
@borat_trades2860 4 жыл бұрын
i start to suspect that being good at these problems is a 2 step process: 1)SEEING many problems solutions, understanding them, memorizing them , 2) recalling solutions or TECHNIQUES when facing similar problems. i understand the solution for this problem now thx u! but how am i supposed to know it's 2 stacks?! i suspect i simply need to see many many solutions and then i will be able to know how to solve similar problems.. am i right?!
@techdose4u
@techdose4u 4 жыл бұрын
Actually you are partially correct. If you have experience then obviously many techniques will immediately come to your mind. But the most important thing about programming is to list down the requirement of the question that is the goal. After that you need to think what operations you would do as a straight forward process. Now you think how to achieve a given work in a shorter time. In this case, according to the unsaid requirement of the question, you needed to maintain postion of brackets and stars. This was an extremely important observation and everyone gets it sooner or later. So solving a question elegantly is all about Observations and experience :)
@upharrastogi3464
@upharrastogi3464 4 жыл бұрын
Great Explanation Surya :)
@techdose4u
@techdose4u 4 жыл бұрын
Thanks
@rishi3308
@rishi3308 4 жыл бұрын
Thanks a lot 😊
@techdose4u
@techdose4u 4 жыл бұрын
Welcome
@humansofcrypto9746
@humansofcrypto9746 4 жыл бұрын
Awesome soln!
@techdose4u
@techdose4u 4 жыл бұрын
Thanks :)
@rogiervdw
@rogiervdw 4 жыл бұрын
Excellent explanation, thank you! Any chance you can explain the dynamic programming solution that's on LC?
@techdose4u
@techdose4u 4 жыл бұрын
If you have doubts then ask it. I don't have time now to make video for DP. Try solving and ask if you get stuck. You will get help.
@arthamsreenivas8858
@arthamsreenivas8858 4 жыл бұрын
Thanks Bro, i was trying with single stack with multiple trials did not work, how can we get 2nd stack idea without reading this solution before actual interview :) ?
@techdose4u
@techdose4u 4 жыл бұрын
You just need to practice. There is no easy way out.
@chandankumarnayak7406
@chandankumarnayak7406 8 ай бұрын
class Solution { public boolean checkValidString(final String s) { int low = 0; int high = 0; for (final char c : s.toCharArray()) { switch (c) { case '(': ++low; ++high; break; case ')': low = Math.max(0, --low); --high; break; case '*': low = Math.max(0, --low); ++high; break; } if (high < 0) return false; } return low == 0; } }
@xapeuuu
@xapeuuu 4 жыл бұрын
Do you know if ()() would be a accepted case? I don't see anything against it in the description.
@techdose4u
@techdose4u 4 жыл бұрын
Yes it will be accepted. Its answer will be TRUE. It is a valid string afteral.
@xapeuuu
@xapeuuu 4 жыл бұрын
@@techdose4u Thanks. I was not getting over the fact that we are not necessarily matching the parenthesis in the most intuitive way. For instance in the case (*)) which is valid -> (()) we are matching the parenthesis with indexes [0,2] and [1,3]. If we knew that the final string would be (()) we would match them differently [0,3], [1,2]. After getting over that i was able to finally understand why this works :)
@techdose4u
@techdose4u 4 жыл бұрын
Great :)
@rajeshbammidy180
@rajeshbammidy180 4 жыл бұрын
I tried using One Stack but my approach fails when we have start in bwn the "(" & ")"
@techdose4u
@techdose4u 4 жыл бұрын
Share your code to get help.
@LTT_VKR
@LTT_VKR 4 жыл бұрын
I am still confused or I don't know how to find the complexity precisely...can you help with that or recommend any videos to watch on that...
@techdose4u
@techdose4u 4 жыл бұрын
Don't think time. Think how many computations you will you do. I have uploaded some basic time complexity videos. You can find blogs on geeksforgeeks as well.
@LTT_VKR
@LTT_VKR 4 жыл бұрын
@@techdose4u okay 👍
@ANANDJULU
@ANANDJULU 3 жыл бұрын
Thanks , liked and subscribed :)
@techdose4u
@techdose4u 3 жыл бұрын
Welcome :)
@krishnkumar2277
@krishnkumar2277 4 жыл бұрын
could you refer some good resource of graph or please make a playlist of graph
@techdose4u
@techdose4u 4 жыл бұрын
I will soon start graph. You can refer geeksforgeeks for graph. It has everything you need. Just filter and study.
@divakaram-xy6si
@divakaram-xy6si 8 ай бұрын
using pointers to keep track of open , star instead of stack would be a more optimal solution.
@f3-faithfitnessfinance
@f3-faithfitnessfinance 4 жыл бұрын
Honestly I didn't get the question I was waiting for your video😂😂
@techdose4u
@techdose4u 4 жыл бұрын
🤣 what's this bro....please try to solve the question first yourself. It will be much more helpful.
@f3-faithfitnessfinance
@f3-faithfitnessfinance 4 жыл бұрын
@@techdose4u 😂😂 I know I did for all the previous problems... But for this one...I tried understanding the question...I was like what's going on🙆‍♂️
@techdose4u
@techdose4u 4 жыл бұрын
😅 Then it's okay.
@hortsss
@hortsss 4 жыл бұрын
same lol
@SR-we1vl
@SR-we1vl 4 жыл бұрын
Well it was a brilliant solution. But what if the interviewer asks do it in O(1) space!? What to do!?
@techdose4u
@techdose4u 4 жыл бұрын
maybe you can check leetcode discussions.
@techgianttechyforever
@techgianttechyforever 3 жыл бұрын
Thanks bro
@techdose4u
@techdose4u 3 жыл бұрын
Welcome
@amanpandey4550
@amanpandey4550 2 жыл бұрын
Another approch - without using extra space' C++ Code- bool checkValidString(string s) { int maxDiff=0; int minDiff=0; for(auto ch : s){ maxDiff+=(ch=='(' || ch=='*') ? 1 : -1; minDiff+=(ch==')' || ch=='*') ? -1 : 1; if (maxDiff < 0) return false; minDiff = max(0, minDiff); } return minDiff==0; }
@vishnugovindan8550
@vishnugovindan8550 4 жыл бұрын
Could you shed some light on how this could be achieved in O(1) space if done greedy?
@techdose4u
@techdose4u 4 жыл бұрын
Someone had already posted in COMMENT section using 2 traversals, though not greedy but search it. You will get an easy O(1) space solution.
@surbhi191
@surbhi191 4 жыл бұрын
int count = 0; for(int i = 0; i=0; i--){ char c = s.charAt(i); if(c==')' || c=='*') count++; else{ if(count==0) return false; count--; } } return true;
@sauravchandra10
@sauravchandra10 Жыл бұрын
Did anyone code the greedy approach which takes o(1) space?
@keerthi442
@keerthi442 4 жыл бұрын
Your really awesome bro
@techdose4u
@techdose4u 4 жыл бұрын
Thanks :)
@AkshayKumar-nh9nh
@AkshayKumar-nh9nh 4 жыл бұрын
Beautiful!
@techdose4u
@techdose4u 4 жыл бұрын
Thanks
@sharathnagendra3318
@sharathnagendra3318 3 жыл бұрын
Thank you :D
@techdose4u
@techdose4u 3 жыл бұрын
Welcome
@s1mple965
@s1mple965 2 жыл бұрын
thanks!!
@techdose4u
@techdose4u 2 жыл бұрын
Welcome
@tanmayshishodia1507
@tanmayshishodia1507 4 жыл бұрын
Great explanation! Kudosss :)
@techdose4u
@techdose4u 4 жыл бұрын
Thanks :)
@ramsankar585
@ramsankar585 4 жыл бұрын
Bro i did it with recursion and it passed 38 test cases and got TLE. can i add memoization in it? I want to solve in this approach.
@techdose4u
@techdose4u 4 жыл бұрын
Yes. If you add memoization then it should pass.
@ramsankar585
@ramsankar585 4 жыл бұрын
Bro i think this is backtracking problem if we solve with recursion. I am little confused whethet we can add memo or not ..
@techdose4u
@techdose4u 4 жыл бұрын
You can obviously add.....you should make 3 way call on seeing star and one way call on seeing opening or closing bracket.
@ramsankar585
@ramsankar585 4 жыл бұрын
Thanks bro. The way u explain makes complicated things much easier. You deserve more subs ❤
@techdose4u
@techdose4u 4 жыл бұрын
I hope our community will grow soon :)
@sanjeevkumar-wm4mn
@sanjeevkumar-wm4mn 4 жыл бұрын
Awesome
@reroyallover9169
@reroyallover9169 Жыл бұрын
thanos khus hua
@AchintoBanerjee
@AchintoBanerjee 4 жыл бұрын
Genius
@techdose4u
@techdose4u 4 жыл бұрын
:)
@ruchi315
@ruchi315 8 ай бұрын
I can't solve any problem like this :(
LRU cache | Leetcode #146
6:33
Techdose
Рет қаралды 26 М.
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 26 МЛН
How many people are in the changing room? #devil #lilith #funny #shorts
00:39
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 50 МЛН
Valid Parenthesis String - Leetcode 678 - Python
13:43
NeetCode
Рет қаралды 75 М.
678. Valid Parenthesis String | DP | Stacks | 2 Pointers | 3 Ways
38:32
L11. Valid Parenthesis String | Multiple Approaches
26:09
take U forward
Рет қаралды 49 М.
How to Solve ANY LeetCode Problem (Step-by-Step)
12:37
Codebagel
Рет қаралды 314 М.
Valid Parentheses - Stack - Leetcode 20 - Python
10:43
NeetCode
Рет қаралды 424 М.
I gave 127 interviews. Top 5 Algorithms they asked me.
8:36
Sahil & Sarra
Рет қаралды 678 М.
Remove K digits | Build lowest number | Leetcode #402
15:30
Techdose
Рет қаралды 90 М.