[LeetCode] Minimum Window Subsequence 最小窗口序列

Posted Grandyang

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[LeetCode] Minimum Window Subsequence 最小窗口序列相关的知识,希望对你有一定的参考价值。

 

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:

Input: 
S = "abcdebdde", T = "bde"
Output: "bcde"
Explanation: 
"bcde" is the answer because it occurs before "bdde" which has the same length.
"deb" is not a smaller window because the elements of T in the window must occur in order.

 

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].

 

s

 

以上是关于[LeetCode] Minimum Window Subsequence 最小窗口序列的主要内容,如果未能解决你的问题,请参考以下文章

LeetCode in Python 76. Minimum Window Substring

leetcode 76. Minimum Window Substring

Leetcode 76: Minimum Window Substring

Leetcode.76 Minimum Window Substring (Java)

leetcode 76-Minimum Window Substring(hard)

leetcode76 Minimum Window Substring