Completd valid palindrome problem