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