100% faster || Stack || simple C++ code
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int removeAlmostEqualCharacters(string str) {\n        stack<pair<char, int>> st;\n        int cnt = 0;\n        st.push({str[0], 0});\n        for(int i = 1; i< str.size(); i++){\n            if( (str[i] == st.top().first && st.top().second == 0 ) \n          || (str[i] == st.top().first + 1 && st.top().second == 0 )\n           || (str[i] +1 == st.top().first && st.top().second == 0) ){\n                cnt ++;\n                st.push(make_pair(str[i], 1));\n            }\n            else{\n                st.push(make_pair(str[i], 0));\n            }\n        }\n        return cnt;\n    }\n};\n```
['Stack', 'C++']