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.
比较难,当时没有写出来这个O(n)的思路,借鉴一下别人的。
本文探讨了如何在复杂度为O(n)的情况下,找到字符串S中包含所有字符T的最小窗口。通过实例解析,展示了求解过程及注意事项。
7696





