当前位置:网站首页>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边栏推荐
猜你喜欢

Chinese garbled code under vscade

C语言实现XML生成解析库(XML扩展)

【学习笔记】反向误差传播之数值微分

Matlab数学建模工具

樂理基礎(簡述)

Principes fondamentaux de la théorie musicale (brève introduction)

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

Target detection for long tail distribution -- balanced group softmax

EKLAVYA -- 利用神经网络推断二进制文件中函数的参数

STM32疑难杂症之ST-LINK Connection error INVALID ROM TABLE
随机推荐
力扣方法总结:双指针
Jetson nano installation tensorflow stepping pit record (scipy1.4.1)
Simply test the two different data transmission methods of content length and chunked
Using super ball embedding to enhance confrontation training
将恶意软件嵌入到神经网络中
E-R画图明确内容
Remplacer l'auto - attention par MLP
深入理解JVM
OpenCV3 6.2 低通滤波器的使用
Using transformer for object detection and semantic segmentation
[C # note] the data in DataGridView saved in WinForm is excel and CSV
SQLyog远程连接centos7系统下的MySQL数据库
Sqlyog remote connection to MySQL database under centos7 system
Summary of solving the Jetson nano installation onnx error (error: failed building wheel for onnx)
利用Transformer来进行目标检测和语义分割
Array and string processing, common status codes, differences between PHP and JS (JS)
Income in the first month of naked resignation
力扣方法总结:滑动窗口
【学习笔记】Matlab自编高斯平滑器+Sobel算子求导
Dynamic extensible representation for category incremental learning -- der