APS.04 String Matching

APS.04 String Matching

From naïve O(nm) to KMP O(n+m): prefix function, rolling hash, and binary search on longest repeated substring.