Animation · 5 steps
This is how an answer is built piece by piece. Use “Next” to go step by step, “Play” runs on its own.

text so far“The cat sat”Modela score for everypossible text piecenew text“The cat sat on”Selectionhighest score: “on” inputoutput: score listappendbecomes the new input