Easy and Straight forward Java Solution with explanation.(Greedy)
APPROACH\n- if two characters has conflicts then changing the right-most character is the most optimal (if you are traversing left to right).\nfor eg:\n\t[a,b,c
**APPROACH**\n- if two characters has conflicts then changing the right-most character is the most optimal (if you are traversing left to right).\nfor eg:\n\t[a,b,c]\n\there is conflit between a and b so we should change \'b\' and it will automatically resolve the conflit with c.\n- we can change to any character to resolve conflict so we will choose a character which don\'t create a new conflict with nearby character.\n- choosing from a to z may be overhelming so we will replace each conflicting character with \'*\' since we don\'t have to return the actual string.\n- each change will increase the count.\n- return count\n\n```\nclass Solution {\n    public int removeAlmostEqualCharacters(String word) {\n        int size = word.length();\n        int count = 0;\n        char ch[] = word.toCharArray();\n        for(int i = 1;i<size;i++)\n        {\n            if((Math.abs(ch[i]-ch[i-1])<=1))\n            {\n            \tch[i] = \'*\';\n                count++;\n            }\n\n        }\n        return count;\n    }\n}\n```
['Greedy', 'Java']