Simple Greedy Solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\nFor ith character, check if it is equal to the adjacent element or alphab
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\nFor ith character, check if it is equal to the adjacent element or alphabetically adjacent, if so, **update it to some other alphabet such that word[i]!=word[i+1] (i<word.length()-1) and word[i]!= word[i-1] (i>0). Increment the count by 1 and also,increment i by 2**, because we have already updated the string for two adjacent characters.\nOtherwise increment i by 1 only.\nHope this helps!\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int removeAlmostEqualCharacters(string word) {\n        int i,op=0;\n        if(word.length()==1) return 0;\n        for(i=0;i<word.length()-1;){\n            if(word[i]==word[i+1] || word[i]==(char)(word[i+1]+1)|| word[i]==(char)(word[i+1]-1)){\n                if(i>0 && i<word.length()-1){\n                    for(char ch=\'a\';ch<=\'z\';ch++){\n                        if(ch!=word[i+1] && ch!=word[i-1]){\n                            word[i]=ch;\n                            break;}}}\n                else if(i==0){\n                    for(char ch=\'a\';ch<=\'z\';ch++){\n                        if(ch!=word[i+1]){\n                            word[i]=ch;\n                            break;}}}\n                op++;\n                i+=2;}\n                else{\n                    i++;}}\n                return op;}};\n```
['Greedy', 'C++']