Python 3 | Greedy one pass | Explanations
Explanation\n- If length of palindrome == 1, return \'\'\n- For even length string, if we found a char that is not a, replace it with a and return\n- For odd le
### Explanation\n- If `length of palindrome == 1`, return `\'\'`\n- For even length string, if we found a char that is not `a`, replace it with `a` and return\n- For odd length string, if we find a char that is not `a` and it\'s not the middle of string, replace it with `a` and return\n- If all `a` in the string, replace the last char to `b`\n### Implementation\n```\nclass Solution:\n    def breakPalindrome(self, palindrome: str) -> str:\n        n = len(palindrome)\n        if n == 1: return \'\'\n        for i, c in enumerate(palindrome):\n            if c != \'a\' and ((i != n // 2 and n % 2) or not n % 2): return palindrome[:i] + \'a\' + palindrome[i+1:]                \n        else: return palindrome[:-1] + \'b\'\n```
['Greedy', 'Python', 'Python3']