cc150: solution to 3.6
cc150: solution to 3.7
Knuth–Morris–Pratt (KMP) algorithm