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 pricingScan once with LPS fallbacks and no backward text movement.
What this asks
Find every pattern occurrence with KMP.
Build the LPS array, scan the text once, and fall back with j = lps[j - 1] on every mismatch.
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