当前位置:网站首页>Summary of one question per day: stack and queue (continuously updated)
Summary of one question per day: stack and queue (continuously updated)
2022-07-02 08:09:00 【Villanelle#】
20. Valid parenthesis disorder map、 Stack 2021/11/21
Given one only includes ‘(’,’)’,’{’,’}’,’[’,’]’ String s , Determines whether the string is valid .
Valid string needs to meet : Opening parentheses must be closed with closing parentheses of the same type . The left parenthesis must be closed in the correct order .
Example :
Input :s = “()[]{}”
Output :true
Input :s = “([)]”
Output :false
Use unordered_map Unordered Association container . Take advantage of the first in and last out nature of the stack , Traversal string , If ([{ Then push it onto the stack , Otherwise )]}, See whether the element at the top of the stack is its corresponding value , If yes, pop up the stack top element , Finally, if the stack is empty after traversal, it is regarded as valid .
class Solution {
public:
bool isValid边栏推荐
- 最长等比子序列
- 力扣方法总结:查找类
- Look for we media materials from four aspects to ensure your creative inspiration
- 乐理基础(简述)
- The hystrix dashboard reported an error hystrix Stream is not in the allowed list of proxy host names solution
- 力扣每日一题刷题总结:字符串篇(持续更新)
- How to back up the configuration before the idea when reinstalling the idea
- C语言实现XML生成解析库(XML扩展)
- 【学习笔记】Matlab自编高斯平滑器+Sobel算子求导
- 应对长尾分布的目标检测 -- Balanced Group Softmax
猜你喜欢

【MnasNet】《MnasNet:Platform-Aware Neural Architecture Search for Mobile》

Real world anti sample attack against semantic segmentation

I'll show you why you don't need to log in every time you use Taobao, jd.com, etc?

Vscode下中文乱码问题

【学习笔记】Matlab自编高斯平滑器+Sobel算子求导

樂理基礎(簡述)

简易打包工具的安装与使用
![Open3d learning note 5 [rgbd fusion]](/img/0a/41d38e4b0295b6674143f3f74a4a8d.png)
Open3d learning note 5 [rgbd fusion]
![Open3d learning notes 1 [first glimpse, file reading]](/img/68/68ea87817dbf788591216a32c9375b.png)
Open3d learning notes 1 [first glimpse, file reading]

【MobileNet V3】《Searching for MobileNetV3》
随机推荐
It's great to save 10000 pictures of girls
High school mathematics compulsory one
我的vim配置文件
力扣每日一题刷题总结:链表篇(持续更新)
用C# 语言实现MYSQL 真分页
Open3d learning notes 1 [first glimpse, file reading]
My VIM profile
Prompt 范式简述
【C#笔记】winform中保存DataGridView中的数据为Excel和CSV
【雙目視覺】雙目矯正
应对长尾分布的目标检测 -- Balanced Group Softmax
Summary of open3d environment errors
C # connect to MySQL database
Nacos service registration in the interface
OpenCV关于x,y坐标容易混淆的心得
Longest isometric subsequence
使用C#语言来进行json串的接收
jetson nano安装tensorflow踩坑记录(scipy1.4.1)
Open3d learning note 3 [sampling and voxelization]
利用超球嵌入来增强对抗训练