lintcode-423
来源:互联网 发布:硬盘开盘数据恢复 编辑:程序博客网 时间:2024/05/20 21:44
class Solution {public: bool isValidParentheses(string& s) { // Write your code here if(0==s.size()||1==s.size()) return false; stack<char> base; for(auto e: s){ if(e=='('||e=='{'||e=='['){ base.push(e); }else{ int val=base.top(); if(e==')'&&val!='('||e=='}'&&val!='{'||e==']'&&val!='['){ return false; } base.pop(); } } return base.empty()?true:false; }};
0 0
- lintcode-423
- LintCode 423:Valid Parentheses
- LintCode 第423题
- LintCode
- lintcode--
- lintcode
- LintCode
- Lintcode
- Lintcode Stack 423 Valid Parentheses
- [Lintcode] #423 有效的括号序列
- Lintcode - Median
- Lintcode - MedianII
- Lintcode - Heapify
- LintCode-组合
- LintCode 子树
- LintCode-加油站
- lintcode-422
- lintcode-189
- Windows自带的造字功能使用
- JavaSE初学笔记之<nio的write事件的深入>
- C语言正数和负数循环右移,左移,把某正数的第m位(从0开始)到n位取反
- 校园招聘笔试总结(转载)
- Material Design学习
- lintcode-423
- UVA 1611
- pta 08-图7 公路村村通 (30分) 最小生成树
- NYOJ746——整数划分(四)
- c++ set的常用用法
- 6.3五大组件之一(服务Service)
- 鼠标经过文本后高亮显示
- 使用ViewFlipper+GestureDetector实现轮播图(APP引导页面)
- HDU 2669 Romantic (扩展欧几里得)