Solution : 1. Add all of the opens, then add all of the closes. This produces the first combination. 2. Remove characters from the string until we find an opening parenthesis. Remove the opening parenthesis and check whether close < open. 3. If close < open, add a closing parenthesis to the string. Next, add the remaining opens, then add the remaining closes. Repeat step 2. If close >= open, repeat step 2
this is the best illustration for recursion tree when called under a loop, every video just draw a two way or three way branch from beginning but this was exactly step by step , thnx
Thank you for your patience and hard work for actually walking us through the recursive process. The recursion tree is clear and solid. You really know what you are teaching unlike most of the LeetCode RU-vidr out there who only copy and paste code. Thanks again!
Read the way of solving it using GeeksForGeeks, AlgoExpert, Leetcode prime solution explanation, couple of youtube videos. Didn't understand it from any, but you. Thank you.
@@mistercorea How does splice work internally? How do you say that splice is an O(1) algorithm? Splice itself cannot be O(1) but at the minimum has to be O(n).
Wow! You did a phenomenal job of explaining this in much simpler terms. Thank you so much for making this. Now, I understand this problem way better. I have one question though - Isn't the time complexity O(n * n!) from the tree diagram you illustrated? n times we are doing n! right, or can we reduce O(n * n!) to O(n!)?
Today marks 3 years since you posted this video. Why have you stopped posting new videos? You are a very good teacher, Sir. You have a divine gift. Recursive thanks to you. PLEASE START POSTING NEW VIDEOS.