string searching: naive, KMP