Greedy
Every time we find almost-equal adjacent chars, we replace the second one.\n\nThis allows us to not worry about the character after the replaced one.\n\nThis is
Every time we find almost-equal adjacent chars, we replace the second one.\n\nThis allows us to not worry about the character after the replaced one.\n\nThis is because we can pick any letter for the replacement.\n\n**C++**\n```cpp\nint removeAlmostEqualCharacters(const string &w) {\n    int res = 0;\n    for (int i = 0; i + res + 1 < w.size(); ++i)\n        res += abs(w[i + res] - w[i + res + 1]) < 2;\n    return res;\n}\n```
['C']