Java easy Solution || String
\nclass Solution {\n    public String breakPalindrome(String palindrome) {\n        int n=palindrome.length();\n        if(n==1){//if length is 1\n            r
```\nclass Solution {\n    public String breakPalindrome(String palindrome) {\n        int n=palindrome.length();\n        if(n==1){//if length is 1\n            return "";\n        }\n        \n        for(int i=0;i<n;i++){\n            \n            //if char is non-\'a\' (but it should not be middle char of odd length string)\n            if(palindrome.charAt(i)!=\'a\' && !(n%2!=0 && i==n/2)){\n                \n                //replace first non-\'a\' character with \'a\'\n                palindrome=palindrome.substring(0,i)+\'a\'+palindrome.substring(i+1);\n                return palindrome;\n            }\n        }\n        \n        //if string has only \'a\' change last character with b\n        palindrome=palindrome.substring(0,n-1)+\'b\';\n        \n        return palindrome;\n    }\n}\n```
['String', 'Greedy', 'Java']