当前位置:网站首页>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边栏推荐
- 浅谈深度学习中的对抗样本及其生成方法
- Longest isometric subsequence
- Data reverse attack under federated learning -- gradinversion
- How to back up the configuration before the idea when reinstalling the idea
- 【MagNet】《Progressive Semantic Segmentation》
- Gensim如何冻结某些词向量进行增量训练
- Network metering - transport layer
- Using transformer for object detection and semantic segmentation
- Global and Chinese markets for Salmonella typhi nucleic acid detection kits 2022-2028: Research Report on technology, participants, trends, market size and share
- Get the width and height of the screen in real time (adaptive)
猜你喜欢

SQLyog远程连接centos7系统下的MySQL数据库

Fundamentals of music theory (brief introduction)

Vscode下中文乱码问题

Programmers can only be 35? The 74 year old programmer in the United States has been programming for 57 years and has not retired

【学习笔记】Matlab自编高斯平滑器+Sobel算子求导
![Open3d learning note 4 [surface reconstruction]](/img/9d/c1c3f2f3d4acd74a2c043571a120b3.png)
Open3d learning note 4 [surface reconstruction]

Carsim-实时仿真的动画同步问题

应对长尾分布的目标检测 -- Balanced Group Softmax

Where do you find the materials for those articles that have read 10000?

Network metering - transport layer
随机推荐
SQL操作数据库语法
In the era of short video, how to ensure that works are more popular?
用C# 语言实现MYSQL 真分页
[binocular vision] binocular stereo matching
Data reverse attack under federated learning -- gradinversion
浅谈深度学习模型中的后门
最长等比子序列
Organigramme des activités
Brief introduction of prompt paradigm
Find and rfind methods in string
Global and Chinese markets for Salmonella typhi nucleic acid detection kits 2022-2028: Research Report on technology, participants, trends, market size and share
Embedding malware into neural networks
Open3d learning note 4 [surface reconstruction]
Meta learning Brief
Summary of solving the Jetson nano installation onnx error (error: failed building wheel for onnx)
针对tqdm和print的顺序问题
How to wrap qstring strings
One book 1078: sum of fractional sequences
Sqlyog remote connection to MySQL database under centos7 system
【Batch】learning notes