Generate Parentheses | Leetcode 22 | Live coding session

preview_player
Показать описание
Here is the solution to "Generate Parentheses" leetcode question. Hope you have a great time going through it.

Chapters
1) 0:00 Explaining the problem out loud
2) 1:10 Question walkthrough
3) 2:00 Naive approach
4) 4:00 Optimized approach
5) 8:00 Coding it up

For discussion/feedback

PS : Please increase the speed to 1.25X
Рекомендации по теме
Комментарии
Автор

Can anyone explain the Time Complexity of the second solution??

dhruvdhiman
Автор

Hi Sensei
I understood if I use direct recursion and check every possibility ... It will give 2^2N *k
I wrote this method only .. somehow it get passed but was very slow... Ur method is far better ...

I can see by ur method we saved so many recursion steps ..
But can u plz also explain how to calculate the Time complexity of this approach ... Thanks in advance 😄

mayankverma
Автор

Why two semi colons in line 24 And 29??

exploringworld
Автор

Hey can you explain why you deleted last character from string?

shivaligakhar
Автор

Why did you pass list argument. Even without passing it we declare as global variable it's gonna wrk right?

rameshtamilselvan
join shbcf.ru