# [727. 最小窗口子序列](https://leetcode-cn.com/problems/minimum-window-subsequence) [English Version](/solution/0700-0799/0727.Minimum%20Window%20Subsequence/README_EN.md) ## 题目描述 <!-- 这里写题目描述 --> <p>给定字符串 <code>S</code> and <code>T</code>,找出 <code>S</code> 中最短的(连续)<strong>子串</strong> <code>W</code> ,使得 <code>T</code> 是 <code>W</code> 的 <strong>子序列</strong> 。</p> <p>如果 <code>S</code> 中没有窗口可以包含 <code>T</code> 中的所有字符,返回空字符串 <code>""</code>。如果有不止一个最短长度的窗口,返回开始位置最靠左的那个。</p> <p><strong>示例 1:</strong></p> <pre><strong>输入:</strong> S = "abcdebdde", T = "bde" <strong>输出:</strong>"bcde" <strong>解释:</strong> "bcde" 是答案,因为它在相同长度的字符串 "bdde" 出现之前。 "deb" 不是一个更短的答案,因为在窗口中必须按顺序出现 T 中的元素。</pre> <p> </p> <p><strong>注:</strong></p> <ul> <li>所有输入的字符串都只包含小写字母。All the strings in the input will only contain lowercase letters.</li> <li><code>S</code> 长度的范围为 <code>[1, 20000]</code>。</li> <li><code>T</code> 长度的范围为 <code>[1, 100]</code>。</li> </ul> <p> </p> ## 解法 <!-- 这里可写通用的实现逻辑 --> <!-- tabs:start --> ### **Python3** <!-- 这里可写当前语言的特殊实现逻辑 --> ```python ``` ### **Java** <!-- 这里可写当前语言的特殊实现逻辑 --> ```java ``` ### **...** ``` ``` <!-- tabs:end -->