1. Your calculation of the mid-point at line 10. It should be dividing by 2, not taking the remainder.

Java

int mid = A.length()/2; // get the number of characters in half the string

2. You use the value of mid to check if the string has an odd number of characters instead of the length of the original string.

3. When you build your string before comparing the two halves, the string n is just the reverse of the first half of the input. it should be the reverse of the second half.