Pattern matching using Z algorithm in Python | Dark Hacker News