17. Generate Parentheses
Given n pairs of parentheses, generate all combinations of well-formed parentheses.
Contoh 1:
Input: n = 3 Output: ["((()))","(()())","(())()","()(())","()()()"]
Contoh 2:
Input: n = 1 Output: ["()"]
Batasan:
1 <= n <= 8
Given n pairs of parentheses, generate all combinations of well-formed parentheses.
Input: n = 3 Output: ["((()))","(()())","(())()","()(())","()()()"]
Input: n = 1 Output: ["()"]
1 <= n <= 8