Maximum operations to erase string
Filed under DE Shaw
The question
Given a string, you can either erase the entire string or erase a prefix s[0:i] only if it matches s[i:2*i]. Find the maximum number of operations to completely erase the string.
No write-up yet. Related questions below have one.
Related DE Shaw questions
Collected from public candidate posts and coding forums. Updated Nov 2026.