153. Generate Parentheses
Given an integer n.Generate all possible combinations of well-formed parentheses of length 2 x N.
Example 1:
Input : n = 3
Output : [ "((()))" , "(()())" , "(())()" , "()(())" , "()()()" ]
Example 2:
Input : 2
Output : [ "(())" , "()()" ]
Now Your Turn!
Pick the correct output for the given inputInput : 1
Still unsure what the problem is asking ?
Let’s go through a few more examples, step by step, to make it clearer.
Constraints:
- 1 <= n <= 8