
Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
As with any good dp problem that uses palindromes, try building the palindrome from the edges
The prime point is to check that no two adjacent characters are equal, so save the past character while building the palindrome.