BEATS 100%  IN PYTHON IN BOTH SPACE AND TIME
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\nbeats 100% in python\n46ms\n\n- Space complexity:\nbeats 100% in python\n16.3 mb\n# Code\n```\nclass Solution:\n    def func(self,a,b):\n        if(a==b):\n            return True\n        elif(abs(ord(a)-ord(b))==1):\n            return True\n        return False\n    def removeAlmostEqualCharacters(self, word: str) -> int:\n        i=0\n        n=len(word)-1\n        word=list(word)\n        ans=0\n        while(i<=n-1):\n            if(self.func(word[i],word[i+1])):\n                word[i+1]="~"\n                ans+=1\n            i+=1\n        print(word)\n        return ans\n```
['Python3']