String. Cache the palindromes and DP.