Leetcode-Question-727: Minimum Window Subsequence

Original Link:

https://leetcode.com/contest/weekly-contest-58/problems/minimum-window-subsequence/

Description:

Given strings S and T, find the minimum (contiguous) substring W of S, so that T is a subsequence of W.

If there is no such window in S that covers all characters in T, return the empty string "". If there are multiple such minimum-length windows, return the one with the left-most starting index.

Example 1:

Note:

  • All the strings in the input will only contain lowercase letters.
  • The length of S will be in the range [1, 20000].
  • The length of T will be in the range [1, 100].

Solution:

 

发表评论

电子邮件地址不会被公开。 必填项已用*标注