solve the valid palindrome problem.