Lyra Care may need to locate the smallest portion of a member message that contains every character from a required search pattern. Given a text string and a pattern string, return the shortest contiguous substring of text that contains all characters in pattern, including duplicate occurrences.
Character matching is case-sensitive, spaces and punctuation are valid characters, and the returned substring must preserve the original text exactly. If multiple shortest substrings exist, return the one with the smallest starting index. Return an empty string when no valid substring exists.
Implement min_covering_window(text, pattern).
text and pattern.text containing every character in pattern with at least the required frequency.def min_covering_window(text, pattern):