||Beats 100%|| very Easy Beginner friendly Java Solution||
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n- first we convert Stri
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n- first we convert String to a char Array\n- check if length of the char Array is less than 2 then return an empty String\n- iterate upto length/2 and check whether the character at index i is not equal to \'a\' if condition satisfied then the character at that index is set to \'a\' which makes the string non palindrome and it will be lexicographically smallest and return it after converting it to string\n- if for loop ends means all the character upto length/2 is a and by changing the middle element does make it non palindrome so to make it non palindrome we make the last charcter to b which is lexicographically smaller\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public String breakPalindrome(String palindrome) {\n        char[] cstr=palindrome.toCharArray();\n        if(cstr.length<2)\n            return "";\n        for(int i=0;i<cstr.length/2;i++)\n        {\n            if(cstr[i]!=\'a\')\n            {\n                cstr[i]=\'a\';\n                return String.valueOf(cstr);\n            }\n\n        }\n\n        cstr[cstr.length-1]=\'b\';\n        return String.valueOf(cstr);\n    }\n}\n```
['Java']