Untitled
DanielGarciaMendez
plain_text
03/27/2025 3:30 AM
180 B
38
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();
}