Yes, I know that find the biggest palidrome simple won't work and that's why I made a method to deal with it(optimizePal). Basically this method checks if there aren't any other palidromes around the one you have that might use parts of it. So if the palidrome was geaaeg this method would check if there aren't any palidrome that might use ge or eg as a part of it. If there are, like in ggeaaegcg, the palidrome will be resized so it doesn't end up destroing the other two (on the example above it would be resized to eaae).
And yes, it was a programming assignment.
