 All Problems
Minimum Window Subsequence
hard
strings
sliding window
dynamic programming
amazon
google
facebook

Given strings s and t, return the minimum window substring of s such that every character of t (including duplicates) is included as a subsequence. Return "" if no such window exists.

Example 1:

Input:
abcdebdde
bde
Output: bcde

Example 2:

Input:
jmeqksfrsdcmsiwvaovztaqenprpvnbstl
irkhs
Output: irhs (or smallest window)

Input format: Line 1: s. Line 2: t.

Output format: Minimum window or empty string.

Run to check your code against the sample cases, or submit to run every case