码迷,mamicode.com
首页 >  
搜索关键字:parentheses    ( 825个结果
括号配对问题——解题心得
DescriptionYou are given a string consisting of parentheses () and []. A string of this type is said to be correct:(a)if it is the empty string(b)if A...
分类:其他好文   时间:2015-07-20 23:19:30    阅读次数:171
UVa 673 Parentheses Balance(栈的使用)
栈Time Limit:3000MSMemory Limit:0KB64bit IO Format:%lld & %lluDescriptionYou are given a string consisting of parentheses()and[]. A string of this type...
分类:其他好文   时间:2015-07-20 15:48:51    阅读次数:113
A - 栈
DescriptionYou are given a string consisting of parentheses()and[]. A string of this type is said to becorrect:(a)if it is the empty string(b)if A and...
分类:其他好文   时间:2015-07-20 09:08:36    阅读次数:119
Generate Parentheses
https://leetcode.com/problems/generate-parentheses/递归,用两个指标left和right来标记出合法规则,之后再left和right都达到n后,满足了可以输出的条件此时,就可以把这个string压入到res中了。 1 class Solution {...
分类:其他好文   时间:2015-07-18 16:54:24    阅读次数:114
Basic Calculator I
问题描述Implement a basic calculator to evaluate a simple expression string.The expression string may contain open ( and closing parentheses ), the plus +...
分类:其他好文   时间:2015-07-15 14:36:25    阅读次数:116
#22 Generate Parentheses
题目链接:https://leetcode.com/problems/generate-parentheses/ Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a...
分类:其他好文   时间:2015-07-14 18:01:42    阅读次数:106
#20 Valid Parentheses
题目链接:https://leetcode.com/problems/valid-parentheses/ Given a string containing just the characters '(', ')','{', '}', '[' and ']', determine if the input string is valid. The brackets m...
分类:其他好文   时间:2015-07-14 15:37:03    阅读次数:109
032 Longest Valid Parentheses
题目:032 Longest Valid Parentheses这道题是典型的堆栈应用class Solution: # @param {string} s # @return {integer} def longestValidParentheses(self, s): ...
分类:其他好文   时间:2015-07-14 13:18:22    阅读次数:102
【leetcode】20. Valid Parentheses
@requires_authorization @author johnsondu @create_time 2015.7.13 11:03 @url [valid parentheses](https://leetcode.com/problems/valid-parentheses/) /***************** * 类别: 栈模拟判断 * 时间复杂度: O(n) * 空间复杂度...
分类:其他好文   时间:2015-07-14 11:22:05    阅读次数:97
#leetcode#Fraction to Recurring Decimal
Given two integers representing the numerator and denominator of a fraction, return the fraction in string format. If the fractional part is repeating, enclose the repeating part in parentheses. ...
分类:其他好文   时间:2015-07-13 10:29:56    阅读次数:115
825条   上一页 1 ... 49 50 51 52 53 ... 83 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!