Easy greedy approach
Code
# Code
```java []
class Solution {
    public int removeAlmostEqualCharacters(String s) {
        int n = s.length();
        int ans = 0;

        char prev = s.charAt(0);
        for (int i = 1; i < n; i++) {
            char ch = s.charAt(i);

            if (ch == prev || ch + 1 == prev || prev + 1 == ch) {
                ans++;
                prev = '@';
            } else {
                prev = ch;
            }
        }
        return ans;
    }
}
```
['String', 'Greedy', 'Java']