HTC One的前盖的间隙问题好像被重视了# PDA - 掌中宝
j*e
1 楼
问题如下。搞了个linear的算法,两个指针往后扫那种,实现起来太
复杂了,费了太多时间调试。有简单的O(n)算法么?
Minimum Window Substring
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)算法么?
Minimum Window Substring
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.