GoalScope — minimum_window_substring (Qwen2.5-Coder-32B-Instruct) — hover a token to see the patched verbalization
↵
<code>↵
def minimum_window_substring(s, t):↵
"""Returns the minimum window substring of s that contains all characters of t."""↵
from collections import Counter↵
if not t or not s:↵
return ""↵
dict_t = Counter(t)↵
required = len(dict_t)↵
l, r = 0, 0↵
formed = 0↵
window_counts = {}↵
output = float("inf"), None, None↵
while r < len(s):↵
character = s[r]↵
window_counts[character] = window_counts.get(character, 0) + 1↵
if character in dict_t and window_counts[character] == dict_t[character]:↵
formed += 1↵
while l <= r and formed == required:↵
character = s[l]↵
if r - l + 1 < output[0]:↵
output = (r - l + 1, l, r)↵
window_counts[character] -= 1↵
if character in dict_t and window_counts[character] < dict_t[character]:↵
formed -= 1↵
l += 1 ↵
r += 1↵
return "" if output[0] == float("inf") else s[output[1] : output[2] + 1]↵
</code>