Posts in 2023
  • Interesting Memory Differences in Valid Parentheses

    Friday, October 20, 2023 in News

    class Solution { public: bool isValid(string s) { stack<char> seen; for (const auto ch : s) { if (ch == '(' || ch == '{' || ch == '[') { seen.emplace(ch); continue; } if (ch == ')') { if (seen.size() <= 0 || …

    Read more