码迷,mamicode.com
首页 >  
搜索关键字:parentheses    ( 825个结果
Leetcode#20 Valid Parentheses
原题地址辅助栈代码: 1 bool isValid(string s) { 2 stack st; 3 4 for (auto c : s) { 5 if (st.empty()) 6 st.p...
分类:其他好文   时间:2015-02-02 21:21:59    阅读次数:120
Leetcode Longest Valid Parentheses
Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the longest...
分类:其他好文   时间:2015-02-02 14:03:33    阅读次数:101
[Leetcode][Python]32: Longest Valid Parentheses
# -*- coding: utf8 -*-'''__author__ = 'dabay.wang@gmail.com'32: Longest Valid Parentheseshttps://oj.leetcode.com/problems/longest-valid-parentheses/Gi...
分类:编程语言   时间:2015-02-01 01:52:20    阅读次数:319
LeetCode --- 22. Generate Parentheses
题目链接: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: "((()))", "(()())", "(...
分类:其他好文   时间:2015-01-31 14:46:33    阅读次数:141
LeetCode --- 20. Valid Parentheses
题目链接:Valid Parentheses Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the correct order, "()" and "...
分类:其他好文   时间:2015-01-30 22:40:16    阅读次数:227
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-01-30 15:55:05    阅读次数:123
21. Generate Parentheses Leetcode Python
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: "((()))", "(()())", "(())()", "()(())", "...
分类:编程语言   时间:2015-01-29 12:43:04    阅读次数:157
[leetcode]Longest Valid Parentheses
Longest Valid Parentheses.
分类:其他好文   时间:2015-01-28 00:43:26    阅读次数:202
[Leetcode][Python]22: Generate Parentheses
# -*- coding: utf8 -*-'''__author__ = 'dabay.wang@gmail.com'22: Generate Parentheseshttps://oj.leetcode.com/problems/generate-parentheses/Given n pair...
分类:编程语言   时间:2015-01-27 23:04:14    阅读次数:162
[Leetcode] 22- Generate Parentheses
原题链接:https://oj.leetcode.com/problemset/algorithms/ 这里用递归的方法实现。递归函数签名为void generate(int left, int right, int n, string prev) 1. left,right分别为当前左右括号的个数,prev缓存之前的临时结果 2. left小于n的时候,可以一直加入左括号 3. ...
分类:其他好文   时间:2015-01-27 16:28:01    阅读次数:120
825条   上一页 1 ... 65 66 67 68 69 ... 83 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!