You are viewing a single comment's thread from:

RE: Software Engineer Interview Tips - Using Hashtable to Reduce Runtime Complexity 软件工程师面试技巧之 使用哈希表降复杂度

in #cn8 years ago

好办法
按着前两天 @kenchung 去研究的python 集合使用的是hash表
那这个题就python去解,转化成集合,判断元素加减2是否是集合元素即可

又学习了,谢谢

Sort:  

集合和哈希表还是有相近的地方,比如O(1)查找和添加。

集合还可以遍例。