leetcode73:minmum-window-substring
2020-12-24 11:28
阅读:598
给出两个字符串S和T,要求在O(n)的时间复杂度内在S中找出最短的包含T中所有字符的子串。
例如:
S ="ADOBECODEBANC"
T ="ABC"
T ="ABC"
找出的最短子串为"BANC".
注意:
如果S中没有包含T中所有字符的子串,返回空字符串 “”;
满足条件的子串可能有很多,但是题目保证满足条件的最短的子串唯一。
Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).
For example,
S ="ADOBECODEBANC"
T ="ABC"
Minimum window is"BANC".
Note:
If there is no such window in S that covers all characters in T, return the emtpy string"".
If there are multiple such windows, you are guaranteed that there will always be only one unique minimum window in S.
下一篇:Windows 安装kafka
文章来自:搜素材网的编程语言模块,转载请注明文章出处。
文章标题:leetcode73:minmum-window-substring
文章链接:http://soscw.com/index.php/essay/37910.html
文章标题:leetcode73:minmum-window-substring
文章链接:http://soscw.com/index.php/essay/37910.html
评论
亲,登录后才可以留言!