iterator usage & solve palindrome