Added problem 4 without using a 'is_palindrome' function