Easy java solution
\n# Code\n\nclass Solution {\n    public String breakPalindrome(String p) {\n        int k=p.length();\n        if(k==1)\n            return "";\n        for(in
\n# Code\n```\nclass Solution {\n    public String breakPalindrome(String p) {\n        int k=p.length();\n        if(k==1)\n            return "";\n        for(int i=0;i<k/2;i++)\n        {\n            if(p.charAt(i)!=\'a\')\n            {\n                return p.substring(0,i)+"a"+p.substring(i+1);\n            }\n        }\n        return p.substring(0,k-1)+"b";\n    }\n}\n```
['Java']