Wolters Kluwer deployment tooling may need to detect a marker such as "ERROR" or "rollback" within a large log string. Implement a function that returns True when a pattern occurs in the text and False otherwise.
The match must be case-sensitive, and the pattern may occur at any position, including the beginning or end of the text. To support large logs efficiently, implement the Knuth-Morris-Pratt (KMP) algorithm rather than repeatedly comparing every possible substring from scratch.
Implement contains_substring(text, pattern).
text and pattern, both strings containing printable ASCII characters.True if pattern is a contiguous substring of text; otherwise return False.def contains_substring(text, pattern):