Solution to Valid Palindrome