You have gemstones in a row, each with a color. In one move, you remove any contiguous palindromic substring. Find the minimum moves to remove all gemstones.
Example: takes moves. Remove , leaving . Then remove . Greedy removal of the longest palindrome doesn't always give the optimal answer. You need interval DP to explore all possible removal sequences.