Sum palindrome-change costs over all substrings | Intuit