#include<iostream>
#include<string>
#include<unordered_map>
#include<stack>
using namespace std;
bool isValid(string s);
int main()
{
cout <<isValid("]")<< endl;
return 0;
}
bool isValid(string s)
{
int n=s.size();
stack<char> a;
unordered_map<char,char>b={
{')','('},
{'}','{'},
{']','['}};
for(char i:s)
{
if(b.count(i))
{
if(a.empty()||a.top()!=b[i])
return false;
a.pop();
}
else
a.push(i);
}
return a.empty();
}
03-07
330
11-10
255
11-11
1891