C# Linq Greedy 1 line
Approach\nGreedy\n\n# Complexity\n- Time complexity:\nO(n)\n\n- Space complexity:\nO(1)\n\n# Code\ncsharp []\npublic class Solution {\n    public int RemoveAlmo
# Approach\nGreedy\n\n# Complexity\n- Time complexity:\n$$O(n)$$\n\n- Space complexity:\n$$O(1)$$\n\n# Code\n```csharp []\npublic class Solution {\n    public int RemoveAlmostEqualCharacters(string word) => word.Aggregate((prev: \'O\', skip: false, res: 0), (a, ch) => a.skip || Math.Abs(ch - a.prev) > 1 ? (ch, false, a.res) : (ch, true, a.res + 1)).res;\n}\n```
['C#']