BEATS 100%
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```java []
class Solution {
    public int removeAlmostEqualCharacters(String word) {
        int count = 0;
        int n = word.length();
        int i = 0;
        while(i<n-1) {
            char cur = word.charAt(i);
            char next = word.charAt(i+1);
            if(cur==next || Math.abs(cur-next) == 1) {
                count++;
                i += 2;
            }
            else 
            i++;
        }
        return count;
    }
}
```
['Java']