Leetcode 20
Leetcode 20
Valid Parentheses
class Solution {
public:
}
bool isValid(string s) {
stack<char> st;
for(auto x:s){
else{
if(st.empty())
return false;
if(bracketMatch(st.top(),x)){
st.pop();
}
else{
return false;
}
}
}
return st.empty();
}
};