Write a function to generate all valid combinations of parentheses
HardProblem Statement
Write a function to generate all valid combinations of parentheses
Sample Input
n = 3
Sample Output
[((())), (()()), (())(), ()(()), ()()()]
Limits
Time: 2s · Memory: 256 MB