Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Minimum Window Substring

Hard Strings

Given strings s and t, print the smallest substring of s that contains every character of t (including duplicates). Print an empty line if no such substring exists. The answer is unique.

Constraints

1 <= len(s), len(t) <= 10^5 English letters

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.