51. Generate Parentheses
MediumRecursion & backtracking
Return every string of n pairs of well-formed parentheses, sorted lexicographically ("(" before ")").
Example 1
Input: n = 3 Output: ["((()))", "(()())", "(())()", "()(())", "()()()"]
Constraints
1 ≤ n ≤ 8