One range table feeds a second table
transcript
A code must be cut into palindromes. Every piece must read the same both ways. How few cuts do you need? Two tables answer it.
The first table has one cell per range. A range is a palindrome if its ends match. And the inside must be a palindrome too.
Take the codes one, two, one. Each is a letter. Single letters are palindromes. The ends match, and the middle code is one. So the whole range is a palindrome.
The second table is over prefixes. Try each last piece, and ask table one. A palindrome piece adds one cut.
The code aab needs one cut, after the two a letters. The code abcde needs four cuts. Every letter ends up alone.
Fill table one by length. Left to right reads cells too early.
Fill the range table by length. Then reuse it in a table over prefixes. Full breakdown in the lecture.