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

Minimum Window Subsequence

Given strings s and t, print the shortest contiguous substring of s that contains t as a subsequence. If several have the same length print the one that starts earliest. Print an empty line if there is none.

Constraints

1 <= len(s) <= 2 * 10^4 1 <= len(t) <= 100

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.