solution to Valid Palindrome