Untitled
DanielGarciaMendez
plain_text
9 months ago
133 B
27
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();
}