d***8 发帖数: 1552 | 1 A long string text, given some characters, find the shortest
substring covering all given characters. | h***n 发帖数: 276 | 2 经典的min cover window O(n),你在版上找找,应该讨论过的
基本思想:
先通过scan找到第一个窗口包含所有感兴趣的字符,随后的scan就修改这个窗口如果后
面又碰到感兴趣的字符,在这个过程中book-keeping见到的最小窗口的值,如果还要纪
录窗口的位置,多加两个变量就好了
【在 d***8 的大作中提到】 : A long string text, given some characters, find the shortest : substring covering all given characters.
| P********l 发帖数: 452 | 3 Check:
http://www.sureinterview.com/shwqst/101005
Also try a search there to see if you are lucky. :) | P********l 发帖数: 452 | 4 also think about the behavior question on the banner of the page, which is
more important in some cases. (show hint gives the answer). The Q&A comes
from one excellent post here. //salute. | j********x 发帖数: 2330 | 5 Sort of difficult to begin, but really simple questions.
【在 d***8 的大作中提到】 : A long string text, given some characters, find the shortest : substring covering all given characters.
|
|