Leetcode 22. Generate Parentheses ||Code+ Explanation + Full recursion flow Walkthrough ||June Daily
Vložit
- čas přidán 6. 09. 2024
- Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
Example 1:
Input: n = 3
Output: ["((()))","(()())","(())()","()(())","()()()"]
Example 2:
Input: n = 1
Output: ["()"]
Seems like it's one of your initial videos! Quite RAW and CRISPY. GOD BLESS YOU...............
I have spent the last couple of days studying backtracking and have watched a few videos and searched online, but I still struggle to comprehend the generate parentheses problem. I appreciate your step-by-step explanation. Thank you. 🙌
your explanation and those flow diagrams>>>>>>>>>>>>>>>>>>>>>>>>>>
I really appreciate your effort of making the entire flow chart. I was very confused with this problem initially, but now it’s crystal clear to me. Thank You for your time and efforts.
Thank you so much for your explanation madam It has been really helpful during my master's.
this is the best explanation i ever got
The only channel where i found backtracking explained with code exactly 💯
I appreciate for your effort on flow chart. It's really helpful.
Thanks mam, your teaching style is next level.. Every thing is clear 👍😀
excellent explanation, totally understood the sum, thankyou you for the lecture!
Best explanation ever seen.Kudos to your hardwork.
you are just so perfect....i can understand no other explanation except your. You are just so perfect.
Thank you so much Nisha ❤️❤️
Your Explanation is really amazing..You are really underrated..Hope your channel becomes popular very soon..
correct code is easily available but proper flowchart of the recursive calls are not available everywhere. Thanks
Thank you so much , great and super easy explanation
very nice logic and explanation
thanks a lot
best video for understanding recursion and backtracking
Very well explained.
alisha i love you yrr 😭😭😭😭 your teaching skills are so good
your smile at the end tells that youwere satisfied with the video by the way great explanation
i m inspired bcz of u 💜 well done
nice explanation
Woahh.Thats flowchart representation and explanation are pretty good to catch in one watch. You really made it easy
Thankyou❤
Thank u for providing easy and detailed explanation with short and understandable code.
I really appreciate your thought process and way you explain ❤
Thank you didi for this very easy explanation ❤
thank you so much didi, best explaination ever
your explanation was very easy and helpful .
Nice explanation ✨✨
Hi Alisha,
I was trying to understand how recursion internal work, find correct bracket but now it's clear to me.
Thanks a lot. Keep it up.!!
👌👌👌explained very very well thank you so much you explained very well
Thank you so much
thank you very much plz don't stop i have watched more than 3 vids of your channel
thanks alot alisha I always check for ur videos whenever I get stuck.
Now, I have came to know that I have problem in BACKTRAKING ...
BTW Great Exp.
Thank you Alishaa !!
your explanation was very easy to digest .
Great
From Yesterdays I watched your helpful video!
Thankyou for making very easy and understandable videos!
that's an apt way to explain this , thanks a lot
Thanks Alisha didi
thanks , very details
awesome explanation easy to understand with flowchart
Oh my god ur just amazing
Thanks alot 🎉 helped me
very nice explanation love it !!
code so simple but i diidn't get it .i mean i can't find out the backtracking step in this code
Same goes for me 😅..
BTW do you know how to improve this thing...
really appreciate your suggestion..
Fabulous explanation mam TQ so much 👏👏
Amazing thought process ,easy
More power to you girl.
mind blowing Explanation🙂🙂🙂🙂
what an explanation wahhhh
The time spent on the diagrams made me give you a like. Thanks!
greatt
Great explanation and nice diagram mam. Thank you very much 🙏🏻
Your channel is so underrated. I'd recommend you to do some podcasts with popular youtubers like striver, ridhhi, arsh goyal, keerti, etc etc.
It'll bring more people to your channel.
(Just an idea to gain popularity :))
Hope you've a great day ma'am 🙏🏻🤗
Great Explanation Mam
Thank you!
Thank you mam
Thank youvso much
appriciate your efforts in making flow chat
thank you
thanks
Thanks!
Awesome explanation. Thankyou!! 🙏🙏
thankqqq sooo much for the wonderful explanation ma'am
very well explained tq but i didnt understand why we dindt pop back when we return plz reply i am so confused about this
You are a genius. Thanks
it would be good if post those slides on any tlgrm channel , btw you explained through tree before proceeding to code , this is the best approach for recursion problems.
Very good explaination
Thank You Very Much. It was really helpful.
Good explanation thank you..
Great Explanation.💝
Love ur explanations...
I learned alot,Thank you mam
Beautiful explanation
WHAT IS SPACE AND TIME COMPLEXITY OF THIS SOLUTION?...
Your videos are really awesome.
Thanks!!
Graciasss helped a lottt
If someone explain me the base case of this code if(curr_str()==n*2 this piece of line
nice video...was looking for a similar tree.
CAN ANYONE TELL ME WHY THIS WAS NOT WORKING................
class Solution {
public void paranthesis(String str,int n,int open,int close,List al){
if(open == n && close == n){
al.add(str);
return;
}
if(open < n){
str = str + "(";
paranthesis(str,n,open+1,close,al);
}
if(close < open){
str = str + ")";
paranthesis(str,n,open,close+1,al);
}
}
public List generateParenthesis(int n) {
List al = new ArrayList();
paranthesis("",n,0,0,al);
return al;
}
}
OUTPUT THAT I GOT:
["((()))","((()())","((()()()","(()(())","(()(()()"]
💗💫
Very helpful thank you 🙏
time and space complexity>?
Both time and space complexity are O(n)
Didi just amazing explanation ever given. Continue giving such nice explanations. Wonderful !!! Didi, did u also post answers to the leetcode contest questoins ???
Can someone help in explaining the time complexity here? And some detailed way of calculating that?
Solved by your logic , watched till 4:56 only
nice video
Thanks !!
Awesome explanation keep it up I want to connect with u for coding practice.
I have my Amazon sde 1 interview on Monday iam very much nervous need your help
excellent explanation, but isn't using pop_back function necessary ??
same question here if you got the answer would you plz explain it to me
I loved the video and understood it completely but the approach that striked my brain was the thumbnail of this video... Anybody here who knows how we can write the code of that approach present in thumbnail....??
Awesome explanation 🙌
I also came up with the same recursion tree as in the thumbnail, Wanted to know if it is possible to solve the problem with that approach ?
That's the only correct tree a/c to code
can you share this flow chart
You are very clear and cute
fannnnnnnnnnnnnnnnnnnnnnnnnnn
code?
aap hindi me padha lete to aur bahtrin samajh me aata
maximum janta hindi wali hoti hai
Thank You!