Python Elegant & Short
\nclass Solution:\n    """\n    Time:   O(n)\n    Memory: O(n)\n    """\n\n    def breakPalindrome(self, palindrome: str) -> str:\n        if len(palindrome) ==
```\nclass Solution:\n    """\n    Time:   O(n)\n    Memory: O(n)\n    """\n\n    def breakPalindrome(self, palindrome: str) -> str:\n        if len(palindrome) == 1:\n            return \'\'\n\n        n = len(palindrome)\n        letters = list(palindrome)\n\n        for i in range(n // 2):\n            if letters[i] > \'a\':\n                letters[i] = \'a\'\n                break\n        else:\n            letters[-1] = \'b\'\n\n        return \'\'.join(letters)\n```\n\nIf you like this solution remember to **upvote it** to let me know.\n
['Python', 'Python3']