Least You Need to Know: Prefix Function, Borders, and KMP Intuition
打开课程
The **prefix function** tracks how much of a pattern already matches itself. That self-overlap information is what lets KMP avoid restarting from scratch after mismatches in pattern matching problems.