I am doing a leetcode algorithm, link.
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
For example, given n = 3, a solution set is:
[
"((()))",
"(()())",
"(())()",
"()(())",
"()()()"
]
I totally have no idea about that.
I do know the number of combination equals to catalan number
but I don't know how to list all the combinations
anyone could give me some hints ? even no code will be good for me