Algorytm Knutha‑Morrisa‑Pratta w języku Python