This theory is part of Premium
The full write-up (worked counting examples, the trap list and the interview playbook) unlocks with a Premium plan, along with every Pro visualizer.
See pricingPrepend the fewest characters to make a palindrome, via KMP matching.
What this asks
Add the fewest characters in front of a string to make it a palindrome.
Match the reversed string against the original with KMP; the unmatched suffix length decides the prepend count.
The full write-up (worked counting examples, the trap list and the interview playbook) unlocks with a Premium plan, along with every Pro visualizer.
See pricing