Notes

Personal notes on various topics

View on GitHub

Minimum Window Substring

Problem Statement

Given two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every character in t (including duplicates) is included in the window. If there is no such substring, return the empty string "".

The test cases will be generated such that the answer is unique.

Examples

Example 1:

Example 2:

Example 3:

Constraints

Code Template

class Solution:
    def minWindow(self, s: str, t: str) -> str:
        # Your code here
        pass

Solutions

Back to Problem List Back to Categories