solution for FauxPalindromes, SRM 564