[Leetcode] Minimum window subsequence minimum Windows sequence

Source: Internet
Author: User

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

If There is no such Windows S in this covers all characters T in, return the empty string "" . If There is 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 have The same length. " Deb "is a smaller window because the elements of T in the window must occur in order.

Note:

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

S

[Leetcode] Minimum window subsequence minimum Windows sequence

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.