Project Euler, Problem 35, Java, ugly with rotations performed on Strings