[Java/C++/Python] Greedy
Explanation\nk is the number of operation we will make.\n\nCheck each adjacent pair s[i] and s[i - 1].\nIf s[i] and s[i - 1] are almost-equal,\nwe will make an 
# **Explanation**\n`k` is the number of operation we will make.\n\nCheck each adjacent pair `s[i]` and `s[i - 1]`.\nIf `s[i]` and `s[i - 1]` are almost-equal,\nwe will make an operation to change `s[i]` to other letter.\nBecause there are `26` letters,\nwe can always make it not almost-equal to `s[i + 1]`.\nSo we can skip the check for `s[i]` and `s[i + 1]`.\n\nFinally we return `k`.\n<br>\n\n# **Complexity**\nTime `O(n)`\nSpace `O(1)`\n<br>\n\n**Java**\n```java\n    public int removeAlmostEqualCharacters(String s) {\n        int k = 0, n = s.length();\n        for (int i = 1; i + k < n; ++i)\n            k += Math.abs(s.charAt(i + k) - s.charAt(i + k - 1)) < 2 ?  1 : 0;\n        return k;\n    }\n```\n\n**C++**\n```cpp\n    int removeAlmostEqualCharacters(string s) {\n        int k = 0, n = s.length();\n        for (int i = 1; i < n; ++i)\n            if (abs(s[i] - s[i - 1]) <= 1)\n                k++, i++;\n        return k;\n    }\n```\n\n**Python**\n```py\n    def removeAlmostEqualCharacters(self, s: str) -> int:\n        i, k = 1, 0\n        while i + k < len(s):\n            k += abs(ord(s[i + k]) - ord(s[i + k - 1])) < 2\n            i += 1\n        return k\n```\n
['C', 'Python', 'Java']