Link to the Question: leetcode.com/problems/generate-parentheses If you think that I missed something in my implementation or if there is a better solution, please mention that in the comment section.
@mandu2fundu4972 ай бұрын
My space complexity analysis in this video is not correct. It should be O(n ^ 2). At every recursive call, new parenthesisSlice is created with one extra space. So, the total space used for parenthesisSlice at the leaf node is 0 + 1 + 2 + .... + 2 * n. which O(n^2).