pub fn kmp(text: &[u8], pattern: &[u8]) -> Vec<usize>Expand description
Knuth-Morris-Pratt exact pattern matching.
Builds a failure (partial match) table in O(m), then scans in O(n). Total time O(n+m), space O(m).
Returns starting positions of all exact occurrences.