LeetCode-4.9-22-M-括号生成( Generate Parentheses)

文章目录


数字 n 代表生成括号的对数,请你设计一个函数,用于能够生成所有可能的并且 有效的 括号组合。
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.

示例:
输入:n = 3
输出:[
“((()))”,
“(()())”,
“(())()”,
“()(())”,
“()()()”
]

思路

解法

发布了194 篇原创文章 · 获赞 20 · 访问量 7941

猜你喜欢

转载自blog.csdn.net/Xjheroin/article/details/105425255
今日推荐