Easy to understand solution
Intuition\n Describe your first thoughts on how to solve this problem. \nIntuition told me there was a pretty simple solution to this problem, and after thiking
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nIntuition told me there was a pretty simple solution to this problem, and after thiking about it for a bit arrived at the conclusion that the amount of changes needed is gonna be the sum of the rounded down division of the size of each group of letters divided by 2. For example if we have a group of 3 similar letters (a,b,c) we only need to change b for the string to no longer have 3 similar letters in a row.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nJust thinking of an easy to implement and easy to read solution I decided on simply looping through the string once, storing the last char into a variable and comparing the last char with the current one, adding the number of almost equal letters to a counter and, whenever the chars are not almost equal or we finish the string, we add the counter / 2 to the total result.\n\n# Complexity\n- Time complexity: O(n) we loop only once the string, so n is the size of the string\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1) we only use the given string and 3 other variables\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nimpl Solution {\n    pub fn remove_almost_equal_characters(word: String) -> i32 {\n        let mut last_char = \' \';\n        let mut counter = 1;\n        let mut total_result = 0;\n        for char in word.chars() {\n            if last_char.to_digit(36) != None && char.to_digit(36).unwrap().abs_diff(last_char.to_digit(36).unwrap()) <= 1{\n                counter += 1;\n            }else{\n                if counter > 1{\n                    total_result += counter / 2;\n                }\n\n                counter = 1;\n            }\n            last_char = char;\n        }\n\n        if counter > 1{\n            total_result += counter / 2;\n        }\n\n        return total_result;\n    }\n}\n```
['Rust']