Bad-algorithm of find substr in mainstr, who can help me? using KMP?