Different Ways to add Parentheses || LeetCode Medium Problem || 2-approach ( Recursion & Dp )

  Рет қаралды 3,839

DSA TechSimplified

DSA TechSimplified

Күн бұрын

Пікірлер: 23
@YashJaiswal-lr7vi
@YashJaiswal-lr7vi 2 ай бұрын
💥💥👏
@akshatuke7382
@akshatuke7382 2 ай бұрын
Nice explanation
@geekieyyy
@geekieyyy Жыл бұрын
very nice explaination
@Virtualexist
@Virtualexist 3 ай бұрын
How did you think of this? Was it by drawing a recursive tree or you learnt and then implemented or you could come up with this approach?
@dsatechsimplified
@dsatechsimplified 3 ай бұрын
I practiced quite a lot of questions, which helped me solve this one. But I must say that the recursive tree helped me solve it quite quickly.
@Virtualexist
@Virtualexist 3 ай бұрын
@@dsatechsimplified Thank you for sharing the insights. Helpful!
@Virtualexist
@Virtualexist 3 ай бұрын
I envy your handwriting haha! Good explanation.
@dsatechsimplified
@dsatechsimplified 3 ай бұрын
Thanks , Maybe I should start giving handwriting classes. First lesson - How to make your pen do all your work . Haha!
@Virtualexist
@Virtualexist 3 ай бұрын
@@dsatechsimplified 😂😂😂 Perfect!
@chillkro25
@chillkro25 9 ай бұрын
Great explanation ❤
@dsatechsimplified
@dsatechsimplified 9 ай бұрын
Thankyou
@vinamrasangal8436
@vinamrasangal8436 8 ай бұрын
Great explanation
@dsatechsimplified
@dsatechsimplified 8 ай бұрын
Glad it was helpful!
@Virtualexist
@Virtualexist 3 ай бұрын
Hamne ans vector ko locally kyu lia? Why did we not pass it by reference or keep it global?
@dsatechsimplified
@dsatechsimplified 3 ай бұрын
Because in this problem we are considering every subtree as a separate tree which brings a result . That's why we use local ans vector. Try to dry run the code and focus more on understanding the recursive tree behavior.
@Virtualexist
@Virtualexist 3 ай бұрын
@@dsatechsimplified Yess, I am trying to understand. I got confused that how is the local copy of each function call preserved, then I saw it is being returned after each call. So it gets saved in the left or right whichever is the parent function call originating from.
@Virtualexist
@Virtualexist 3 ай бұрын
@@dsatechsimplified Thanks a lot for prompt responses! 😇🙏🏼 Best wishes to you for your growth!
@dsatechsimplified
@dsatechsimplified 3 ай бұрын
thankyou so much
@shay2559
@shay2559 4 ай бұрын
bravo
@RahulRaj-bw2hc
@RahulRaj-bw2hc 2 ай бұрын
After apply Dp your code perform worst than the recursion. Earlier it was 8 ms beat 48% user but After apply Dp it reduce to 18ms and 5% Beat the solution. You are not assign value to Dp, you are only using the value to find the is it present in the Dp or not.
@arpit9895
@arpit9895 2 ай бұрын
yess broiiii
@dsatechsimplified
@dsatechsimplified 2 ай бұрын
You can optimise your code accordingly. Actually my idea for creating this video is to explain how can you approach this question. Once you are able to solve it by your own you can easily optimize your code.
@shashankshekhar8186
@shashankshekhar8186 Жыл бұрын
Content is very good but the background noise sucks
Different Ways to Add Parentheses | Leetcode 241
22:25
Techdose
Рет қаралды 1,1 М.
How Many Balloons To Make A Store Fly?
00:22
MrBeast
Рет қаралды 149 МЛН
5 Simple Steps for Solving Any Recursive Problem
21:03
Reducible
Рет қаралды 1,2 МЛН
241. Different Ways to Add Parentheses (Leetcode Medium)
14:06
Programming Live with Larry
Рет қаралды 2,7 М.
Leetcode  241 - Different Ways to Add Parentheses - Python Solution
9:59
Data Engineering Studies
Рет қаралды 349
Score of Parentheses | Leetcode 856 | 2 approaches | Stack | Day-17
24:51
Different Ways to Add Parentheses - Leetcode 241 - Python
15:14
NeetCodeIO
Рет қаралды 14 М.
Dynamic Programming - Learn to Solve Algorithmic Problems & Coding Challenges
5:10:02