Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.
For example, givenn= 3, a solution set is:
["((()))", "(()())", "(())()", "()(())", "()()()" ]
有效組合的基本條件是有多少個左括號,就得有相應(yīng)的右括號與之對應(yīng)上。 所以第二個判斷條件是 right < left. 如果將right < max, 得到的結(jié)果是左右括號相等的組合數(shù), 不考慮是否有效。

you