最小覆盖子串,求s 覆盖 t的最短子串

string getAnwser(string s, string t)
{
    unordered_map need,window; // window里包含need中的字符以及数量和need拥有的字符以及数量
    for(auto i:t) need[i]++;
    int left = 0, right = 0;
    int valid = 0;int len = INT_MAX,start = 0;
    while(right

 

你可能感兴趣的:(刷题,算法,leetcode)