Try all ways to partition and check if each letter stays in one part.
With length , there are ways to place partition boundaries. Checking each is expensive.
Can you find where each partition must end?
The trap
Try all ways to partition and check if each letter stays in one part.
With length , there are ways to place partition boundaries. Checking each is expensive.
Can you find where each partition must end?