My phone number (which I will not be sharing here) has a neat property where there is a two digit number, which when iteratively removed from my phone number will eventually remove all the digits. For example if my phone number were
Then by repeatedly removing
ab we would eventually get nothing (I encluse the string I am removing in brackets to make it clear)
abaababb[ab] abaab[ab]b aba[ab]b ab[ab] [ab]
Now to generalize this property lets have any string. A "minimal eraser" of that string will be the smallest substring such that if iteratively removed it will eventually make the string empty.
Some examples at the bottom.
Task and Scoring
Warning: This challenge is not code-golf. Do not assume it is without reading the scoring
Your challenge will be to take a string as input and output a minimal eraser of that string.
Your answers will be scored by taking them as a string of bytes and calculating that string's minimal eraser. The length in bytes of that eraser is your score, with lower being better.
Your answer must support strings containing all printable ascii plus any characters that appear in your program.
abaababbab -> ab baababbab -> baababbab baababab -> baababab echoecho -> echo ototoo -> oto ibiibibii -> ibi aabaabaa -> abaa / aaba