Back to problems

Implement minimum window substring with counts

Algorithm · DoorDash · Medium

Design an implementation of min_window_with_counts(s: str, t: str) -> tuple[int, int] that returns the inclusive zero-based boundaries of the shortest contiguous segment of s whose characters cover every symbol in t with at least the required multiplicity. Matching is case-sensitive: 'a' and 'A' are distinct characters. Whitespace and punctuation are treated as normal ASCII characters. The segment must be contiguous, so you may not skip over characters in s. If no valid…

Checking your access…