Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
Have you met this question in a real interview?
Example
Given n = 3
, a solution set is:
"((()))", "(()())", "(())()", "()(())", "()()()"
s
时间: 2024-12-05 05:25:42