Minimum Window Substring

Given strings *s* and *t*, return the minimum window in *s* which will contain all characters in *t*. If no such window, return empty string. (Sliding-window + hash).

Input Format

Two lines: string s, then string t.

Output Format

The minimum window substring.

Constraints

  • 1 <= len(s), len(t) <= 10^5.

Examples

Example 1:

Input:

s = "ADOBECODEBANC"
t = "ABC"

Output:

BANC

Explanation:

"BANC" is the smallest window covering A, B, and C.

Loading...
Minimum Window Substring - Strings DSA Problem