[palindrome] Updated according to the new definition of P