Java Solution
Code\n\nclass Solution {\n    public int removeAlmostEqualCharacters(String word) {\n        char a,b;\n        int res=0;\n        for(int i=0;i<word.length()-
# Code\n```\nclass Solution {\n    public int removeAlmostEqualCharacters(String word) {\n        char a,b;\n        int res=0;\n        for(int i=0;i<word.length()-1;){\n            a=word.charAt(i);\n            b=word.charAt(i+1);\n            if(a==b || (a+1)==b || (a-1)==b){\n                res++;\n                i+=2;\n            }\n            else{\n                i++;\n            }\n        }\n        return res;\n    }\n}\n```
['Two Pointers', 'Java']