Python Solution. Readable. simple code.
\nclass Solution(object):\n    def breakPalindrome(self, palindrome):\n        """\n        :type palindrome: str\n        :rtype: str\n        """ \n        p1
```\nclass Solution(object):\n    def breakPalindrome(self, palindrome):\n        """\n        :type palindrome: str\n        :rtype: str\n        """ \n        p1 = 0\n        p2 = len(palindrome)-1\n        new_pal = list(palindrome)\n        while p1 < p2:\n            if new_pal[p1] != "a":\n                new_pal[p1] = "a"\n                return "".join(new_pal)\n            p1+=1\n            p2-=1\n        if len(new_pal) == 1: return ""\n        new_pal[-1] = "b"\n        return "".join(new_pal)\n```\nAlright.\n**Explanation**\nFirst of all you should know how to find a palindrom.\n**Given** : TENET\n**Using**: Two pointers. One far right, the other far left.\n```\nT  E  N  E  T\n^           ^\nT == T\n\nT  E  N  E  T\n   ^     ^\nE == E\n\nT  E  N  E  T\n      ^^\nN == N\nYay! valid palindrome\n```\nYou can break a pallindrome at any of the point   T=T; E=E; N=N.\n**Rules** : \n1. Only choose / change one element .\n2. Only change element at the first pointer. \n3. If the above (rule 2) is not possible, change the element last element.\n\nNow, given the following condition we can\'t just change an element to any letter :\n\n**Condition**\n```...string becomes the lexicographically smallest possible```\nLexicographical order : a < b < c < d < e ..... < z . \na is smallest, followed by b then c... z is largest. As a consequence :\n*Reason for rule 2* : \nT E N E T : (changing element at first pointer vesus element at second pointer)\n(A) E N E T < T E N E (A)   -: (A) E N E T  lexicographically smallest\nT (A) N E T < T E N (A) T   -: T (A) N E T   lexicographically smallest\n\n*Reason for rule 3 :*\nGiven : A A A A C , lexicographically smallest : A A A A B \nGiven : A A A A A , lexicographically smallest RESULT -  A A A A B \n\nGenerally, think about how words are arranged in the dictionary.\n\nIntuitively to get the lexicographically smallest string possible you have two options, a or b.\n\n**Intuition**\nYou can only choose one letter a or b. And please,**Remember rule 1** . \nIf you find a non-\'a\' element change it to \'a\'. **Remember rule 2**\nIf every element is an "a", then change the last element to "b". **Remember rule 3**\n\n**Algorithm**\n* Iterate through the palindrome string,\n* If the element at the first pointer is "a" you shouldnt change that. Continue.\n* When the element at the first pointer is not "a", change it to "a" return the modified string\n* If no change has occured and the iteration ends,\nCheck: \n* If the string contains only one letter, no possible change can be made return empty string\n* Else change the last letter to b and return the modified string.\n
['Two Pointers', 'Python']