LeetcodeValid Parentheses
Posted wuezs
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了LeetcodeValid Parentheses相关的知识,希望对你有一定的参考价值。
题目链接:https://leetcode.com/problems/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 "()[]{}"
are all valid but "(]"
and "([)]"
are not.
思路:
用栈,easy。。
算法: