Skip to content

Commit

Permalink
Update Readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
wisdompeak authored Nov 24, 2019
1 parent 877b5d6 commit 5adadd3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Trie/1268.Search-Suggestions-System/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
#### 解法2:
有一种非常取巧的方法,那就是将所有product按照字典排序。然后查找searchWord在里面的位置(用lower_bound定位),得到的就是字典序恰好大于等于searchWord的那个单词。我们查看以这个单词开始的连续三个单词,是否与searchWord共享指定书目的前缀,是的话就相应收入囊中。

这种方法可以不必理会products中是否存在重复。但是第一步排序的过程其实比较耗时,但是题目给出了```1 <= Σ products[i].length <= 2 * 10^4```,这就是暗示了字符串排序的复杂度是可以接受的。
这种方法可以不必理会products中是否存在重复。但是第一步排序的过程其实比较耗时,不过题目给出了```1 <= Σ products[i].length <= 2 * 10^4```,这就是暗示了字符串排序的复杂度是可以接受的。

0 comments on commit 5adadd3

Please sign in to comment.