☕ Java solution ✅ || 😼 Beats 100.00% ✨
\n\njava []\nclass Solution {\n    public int removeAlmostEqualCharacters(String s) {\n        int count = 0, i = 1;\n        while (i < s.length()) {\n        
![Screenshot_1.png](https://assets.leetcode.com/users/images/d05ddc2a-9b1c-45f9-8e69-3261917bb05b_1728402136.3909369.png)\n\n```java []\nclass Solution {\n    public int removeAlmostEqualCharacters(String s) {\n        int count = 0, i = 1;\n        while (i < s.length()) {\n            if (Math.abs(s.charAt(i) - s.charAt(i - 1)) <= 1) {\n                count++;\n                i += 2;\n            } else {\n                i++;\n            }\n        }\n        return count;\n    }\n}\n\n```
['Java']