Solution for Valid Palindrome.