update solution and case for valid palindrome.