Untitled

 avatar
DanielGarciaMendez
plain_text
a month ago
133 B
25
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