Prefix function. Knuth–Morris–Pratt algorithm | Hacker News Reader