101. Generate Parentheses

Return all valid combinations of n pairs of parentheses.
Example 1
Input: n = 1
Output: ["()"]
Explanation: The only pair of parentheses.
Example 2
Input: n = 3
Output: ["((()))","(()())","(())()","()(())","()()()"]
Explanation: Five valid combinations for n=3.
mediumrecursionstrings
JavaScript
Loading...
Line 1, Char 1