C++ || fastest || O(n) || Intuitive || easy
O(n)\nIt is given in question that string is Palindrome and we have to remove the one character only ,so that string become non Palindromic , so  that it is  le
O(n)\nIt is given in question that string is Palindrome and we have to remove the one character only ,so that string become non Palindromic , so  that it is  lexicographically smallest, first thing that comes in mind is that traverse the string and replace the character that does not equal to a,  but it approach will fail for this testcase "aa" or "aaa" ,now ,  To handle this case we will replace last character with b ,Still our approach will fail for some case like "ab", \n\n"what we will do is that if run loop for 0 to n/2  if we find any character that does not equal to a replace and return the string other-wise replace last character with b"\n\n```\nclass Solution {\npublic:\n    string breakPalindrome(string s) {\n        int n = s.size(); //size of string \n        if(n==1 || n==0)  //return empty string if size==1 or size==0\n            return "";\n        \n        for(int i=0; i<n/2; i++) {\n            if(s[i]!=\'a\') {\n                s[i] = \'a\'; // character doesnot equal to \'a\' replace it with a and return the string\n                return s;\n            }\n        }\n        \n        s[n-1] = \'b\'; // change the last  character with b\n        return s;\n    }\n};\n// why we run loop to n/2 not n because it will make Palindromic string for some cases like "aba"\n```\n
[]