Leetcode 22. Generate Parentheses ||Code+ Explanation + Full recursion flow Walkthrough ||June Daily
HTML-код
- Опубликовано: 12 сен 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.
Your Explanation is really amazing..You are really underrated..Hope your channel becomes popular very soon..
The only channel where i found backtracking explained with code exactly 💯
Thanks mam, your teaching style is next level.. Every thing is clear 👍😀
you are just so perfect....i can understand no other explanation except your. You are just so perfect.
Thank you so much Nisha ❤️❤️
Woahh.Thats flowchart representation and explanation are pretty good to catch in one watch. You really made it easy
Thankyou❤
your smile at the end tells that youwere satisfied with the video by the way great explanation
I appreciate for your effort on flow chart. It's really helpful.
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.!!
Best explanation ever seen.Kudos to your hardwork.
excellent explanation, totally understood the sum, thankyou you for the lecture!
Thank you so much for your explanation madam It has been really helpful during my master's.
alisha i love you yrr 😭😭😭😭 your teaching skills are so good
thank you very much plz don't stop i have watched more than 3 vids of your channel
Thank u for providing easy and detailed explanation with short and understandable code.
very nice logic and explanation
thanks a lot
this is the best explanation i ever got
best video for understanding recursion and backtracking
I really appreciate your thought process and way you explain ❤
i m inspired bcz of u 💜 well done
Thank you Alishaa !!
your explanation was very easy to digest .
correct code is easily available but proper flowchart of the recursive calls are not available everywhere. Thanks
From Yesterdays I watched your helpful video!
Thankyou for making very easy and understandable videos!
Thank you so much , great and super easy explanation
thanks alot alisha I always check for ur videos whenever I get stuck.
your explanation was very easy and helpful .
The time spent on the diagrams made me give you a like. Thanks!
👌👌👌explained very very well thank you so much you explained very well
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 🙏🏻🤗
Nice explanation ✨✨
Thank you didi for this very easy explanation ❤
nice explanation
thank you so much didi, best explaination ever
Very well explained.
Now, I have came to know that I have problem in BACKTRAKING ...
BTW Great Exp.
Thank you so much
that's an apt way to explain this , thanks a lot
Didi just amazing explanation ever given. Continue giving such nice explanations. Wonderful !!! Didi, did u also post answers to the leetcode contest questoins ???
awesome explanation easy to understand with flowchart
very nice explanation love it !!
More power to you girl.
Great
Oh my god ur just amazing
Amazing thought process ,easy
mind blowing Explanation🙂🙂🙂🙂
Fabulous explanation mam TQ so much 👏👏
thanks , very details
very well explained tq but i didnt understand why we dindt pop back when we return plz reply i am so confused about this
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.
appriciate your efforts in making flow chat
thankqqq sooo much for the wonderful explanation ma'am
Awesome explanation. Thankyou!! 🙏🙏
Thanks Alisha didi
Thanks alot 🎉 helped me
what an explanation wahhhh
Great Explanation Mam
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..
Thank You Very Much. It was really helpful.
You are a genius. Thanks
Great Explanation.💝
Thank you!
WHAT IS SPACE AND TIME COMPLEXITY OF THIS SOLUTION?...
Thanks!
Thank youvso much
Good explanation thank you..
Thank you mam
I learned alot,Thank you mam
Very good explaination
thanks
thank you
Love ur explanations...
nice video...was looking for a similar tree.
greatt
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
Solved by your logic , watched till 4:56 only
Graciasss helped a lottt
Your videos are really awesome.
Thanks!!
💗💫
Beautiful explanation
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
time and space complexity>?
Both time and space complexity are O(n)
Very helpful thank you 🙏
If someone explain me the base case of this code if(curr_str()==n*2 this piece of line
Can someone help in explaining the time complexity here? And some detailed way of calculating that?
can you share this flow chart
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
fannnnnnnnnnnnnnnnnnnnnnnnnnn
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:
["((()))","((()())","((()()()","(()(())","(()(()()"]
nice video
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....??
You are very clear and cute
code?
aap hindi me padha lete to aur bahtrin samajh me aata
maximum janta hindi wali hoti hai
Thank You!