题目: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....
分类:
编程语言 时间:
2014-08-02 12:19:33
阅读次数:
255
Longest Valid ParenthesesGiven a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substr...
分类:
其他好文 时间:
2014-08-02 04:22:40
阅读次数:
248
解法:用栈,注意栈的用法和switch的用法 1 class Solution { 2 public: 3 bool isValid(string s) { 4 5 stack istack; 6 string::iterator p=s.b...
分类:
其他好文 时间:
2014-07-31 12:12:46
阅读次数:
229
题目:Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the....
分类:
编程语言 时间:
2014-07-26 09:55:27
阅读次数:
204
题目:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in t....
分类:
编程语言 时间:
2014-07-26 09:53:27
阅读次数:
254
Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the longest...
分类:
其他好文 时间:
2014-07-24 12:11:55
阅读次数:
253
DFS and using stack to validate candidates.class Solution {public: bool isValid(const string &s) { stack stk; for (int i = 0; i &...
分类:
其他好文 时间:
2014-07-22 00:28:34
阅读次数:
217
Parencodings
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 19409
Accepted: 11718
Description
Let S = s1 s2...s2n be a well-formed string of parentheses. S ...
分类:
其他好文 时间:
2014-07-18 13:27:19
阅读次数:
204
[LeetCode]Generate Parentheses...
分类:
其他好文 时间:
2014-07-17 15:17:19
阅读次数:
181
Generate ParenthesesGivennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a sol...
分类:
其他好文 时间:
2014-07-16 18:07:04
阅读次数:
146