Untitled
DanielGarciaMendez
plain_text
a year ago
133 B
36
Indexable
stack<char> st;
string s = "(()())";
for (char ch : s) {
if (ch == '(') st.push(ch);
else if (!st.empty()) st.pop();
}Editor is loading...
Leave a Comment
stack<char> st;
string s = "(()())";
for (char ch : s) {
if (ch == '(') st.push(ch);
else if (!st.empty()) st.pop();
}