Java [0 ms]
\n\nclass Solution {\n    public String breakPalindrome(String palindrome) {\n        \n        char[] ch = palindrome.toCharArray(); \n        int n = ch.lengt
\n```\nclass Solution {\n    public String breakPalindrome(String palindrome) {\n        \n        char[] ch = palindrome.toCharArray(); \n        int n = ch.length/2;\n        \n        for (int i = 0; i < n; i++) {\n            \n            if (ch[i] != \'a\') {\n                ch[i] = \'a\';\n                return String.valueOf(ch);\n            }\n        }\n        \n        if (palindrome.length() > 1) {\n            ch[ch.length - 1] = \'b\';\n            return String.valueOf(ch);\n        }\n        \n        return "";\n        \n    }\n}\n```
[]