Explained - Greedy - single pass || very simple and easy to understand solution
Approach \n- Iterate from i = 1 to the string end.\n- For each i check if its prev char is almost equal aplohabet or not => where abs diff of current char and p
# Approach \n- Iterate from i = 1 to the string end.\n- For each i check if its prev char is almost equal aplohabet or not => where abs diff of current char and prev char is less than equal to 1.\n- If almost equal found then we have to change the curr index char to a char diff from prev as well as diff from the next. So we increment the change count. We don\'t hv to care about the what the new char will be.\n- Also if we change the char to a new one that means we are sure that the next char should not be checked so iterate one more to skip check for the immidiate next char.\n\n### C++\n```\nint removeAlmostEqualCharacters(string word) {\n    int ans = 0;\n    for(int i = 1; i < word.size(); i ++){\n        if(abs(word[i] - word[i-1]) <= 1){ ans++; i++; }\n    }\n    return ans;\n}\n```\n\n### Java\n```\npublic int removeAlmostEqualCharacters(String word) {\n    int ans = 0;\n    for(int i = 1; i < word.length(); ++i){\n        if(Math.abs(word.charAt(i) - word.charAt(i-1)) <= 1) { ans++; i++; }\n    }\n    return ans;\n}\n```\n\n\n---\n\n\n<b>Here is an article of my last interview experience - A Journey to FAANG Company, I recomand you to go through this to know which all resources I have used & how I cracked interview at Amazon:\nhttps://leetcode.com/discuss/interview-experience/3171859/Journey-to-a-FAANG-Company-Amazon-or-SDE2-(L5)-or-Bangalore-or-Oct-2022-Accepted\n\n---
['C++', 'Java']