Python with Regex, two candidates
Check two candidates:\n1) Replace the first non-\'a\' with \'a\'.\n2) Replace the last letter with \'b\'.\n\ndef breakPalindrome(self, p):\n    for s in re.sub(
Check two candidates:\n1) Replace the first non-`\'a\'` with `\'a\'`.\n2) Replace the last letter with `\'b\'`.\n```\ndef breakPalindrome(self, p):\n    for s in re.sub(\'[^a]\', \'a\', p, 1), p[:-1] + \'b\':\n        if s < s[::-1]:\n            return s\n    return \'\'        \n```
[]