Added is_palindrome function for problem 4.
Solved problem 4.