pub fn KMPSearch(text: &str, pattern: &str) -> PyResult<Vec<usize>>
Expand description

Returns a vector of indices where the pattern matches in the text using KMP algorithm.

§Arguments

  • text - The text to search for the pattern.
  • pattern - The pattern to search for in the text.

§Returns

A Python list containing the indices where the pattern matches in the text.