Palindrome code for HW 4