String matching problem (including three algorithms: BM, BF.KMP)