Generate Parentheses
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:
1 | [ |
思路:自己没想出来,看的别人的代码,只是能看懂,并不能自己想明白其中的一些细节,先mark一下,这道题很难。
代码如下:
1 | class Solution { |