0 ms | Faster than 100%
If string size is 1, return an empty string.\n2.  If lowest charcter in string is not \'a\', simply set string[0] = \'a\' and return string.\n3.  Else now we ha
1. If string size is 1, return an empty string.\n2.  If lowest charcter in string is not \'a\', simply set string[0] = \'a\' and return string.\n3.  Else now we have to convert a char in string to \'a\' such that resultant is of minimum lexicographical order. For that we will check first non-occurence of any other charcter than \'a\' in that string and replace it with \'a\', If we don\'t find any occurence of any other character in that string, that simply means that string contains only of letter \'a\', so in that case we will change last char of string to \'b\';\n4.  **Most Important point**  In case where string= "aba", we cannot convert \'b\' into \'a\', so for this I have checked for a very intersting case, do check in my code and comment.\n\n\t\t\t\t\t\n\t\t\t\t\tstring breakPalindrome(string s) {\n\t\t\t\t\t\tif(s.size()==1) return "";\n\t\t\t\t\t\tchar lowest=\'z\';\n\t\t\t\t\t\tfor(auto i:s){\n\t\t\t\t\t\t\tif(i<lowest) lowest=i;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(lowest!=\'a\') {s[0]=\'a\'; return s;}\n\n\t\t\t\t\t\tint i=0,j=s.size()-1;\n\t\t\t\t\t\twhile(i<=j){\n\t\t\t\t\t\t\tif(s[i]!=lowest) {\n\t\t\t\t\t\t\t\tif((j+1)%2!=0 && i==(j+1)/2) {i++; continue;}\n\t\t\t\t\t\t\t\ts[i]=lowest; \n\t\t\t\t\t\t\t\treturn s;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ts[j] = lowest+1;\n\t\t\t\t\t\treturn s;\n\t\t\t\t\t}\n
['String', 'C']