shorter palindrome checker using string builder