pub fn KMPSearch(text: &str, pattern: &str) -> PyResult<Vec<usize>>
Returns a vector of indices where the pattern matches in the text using KMP algorithm.
text
pattern
A Python list containing the indices where the pattern matches in the text.