题目: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set i ...
分类:
其他好文 时间:
2017-05-07 23:04:35
阅读次数:
112
题目: Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators ...
分类:
其他好文 时间:
2017-05-07 22:04:59
阅读次数:
229
Description Let S = s1 s2...s2n be a well-formed string of parentheses. S can be encoded in two different ways: q By an integer sequence P = p1 p2...p ...
分类:
其他好文 时间:
2017-05-07 14:05:12
阅读次数:
137
【题目】 Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set ...
分类:
其他好文 时间:
2017-05-06 14:12:06
阅读次数:
214
2017-5-5 https://leetcode.com/problems/valid-parentheses/#/description http://www.jiuzhang.com/solution/valid-parentheses/ 题目:Given a string containin ...
分类:
其他好文 时间:
2017-05-05 23:21:11
阅读次数:
435
Given a string containing just the characters '(', ')', '{', '}','[' and ']', determine if the input string is valid. The brackets must close in the c ...
分类:
其他好文 时间:
2017-05-03 20:30:57
阅读次数:
121
A. Pieces of Parentheses 将括号串排序,先处理会使左括号数增加的串,这里面先处理减少的值少的串;再处理会使左括号数减少的串,这里面先处理差值较大的串。确定顺序之后就可以DP了。 时间复杂度$O(n^3)$。 B. Stars in a Can 求出三维凸包,枚举一个面,求出距 ...
分类:
其他好文 时间:
2017-05-02 00:39:28
阅读次数:
351
CSU - 1542 Flipping Parentheses Time Limit: 5000MS Memory Limit: 262144KB 64bit IO Format: %lld & %llu Submit Status Description Input Output Sample I ...
分类:
其他好文 时间:
2017-04-29 20:01:14
阅读次数:
181
方法:直接使用栈的数据结构对相关字符处理即可 ...
分类:
其他好文 时间:
2017-04-26 10:13:37
阅读次数:
106