Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
A parentheses string is well-formed if every opening parenthesis ( has a corresponding closing parenthesis ) and the pairs are properly nested.
Example 1:
Input: n = 3
Output: ["((()))","(()())","(())()","()(())","()()()"]
Explanation: All 5 valid arrangements of 3 pairs of parentheses.
Example 2:
Input: n = 1
Output: ["()"]
Explanation: The only valid arrangement of 1 pair of parentheses.
Example 3:
Input: n = 2
Output: ["(())","()()"]
Explanation: Both valid arrangements of 2 pairs of parentheses.
1 <= n <= 8