← Back to all problems
Hard

Minimum Window Substring

Updated Feb 24, 2026

Problem

Return the minimum window in s that contains all chars of t.

Constraints

1 <= s.length, t.length <= 10^5

Examples

Example 1

Input: {"s": "ADOBECODEBANC", "t": "ABC"}
Output: "BANC"

Function Signature

def minWindow(self, s: str, t: str) -> str

How to Submit

Implement a Solution class with a minWindow method.

Your method will be called with the input parameters and should return the answer.