原题
https://leetcode.com/problems/generate-parentheses/
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
思路
使用动态规划,分析子问题:每次加括号要么加在外面,要么加在旁边。
https://leetcode.com/problems/generate-parentheses/
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
使用动态规划,分析子问题:每次加括号要么加在外面,要么加在旁边。
Update your browser to view this website correctly. Update my browser now