Your question is Substring Search Scripting. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
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):