C++ solution ( Beats 100%)
\n\n# Complexity\n- Time complexity:O(n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity:O(n)\n Add your space complexity here, e.g. O(n) \n\n
\n\n# Complexity\n- Time complexity:O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int removeAlmostEqualCharacters(string word) {\n        int count=0;\n        vector<int> integer;\n        for(int i=0;i< word.length();i++ ){\n            char x = word.at(i);\n            integer.push_back(int(x));\n        }\n        for(int i=0;i<integer.size()-1;i++){\n            if(integer[i]==integer[i+1]||(integer[i]==(integer[i+1]-1))||(integer[i]-1)==integer[i+1]){\n                count++;\n                i++;\n            }\n        }\n        return count;\n    }\n};\n```
['C++']