摘要: 这道题目看起来很简单,但是用简单的枚举超时。然后用hash存储,这样访问任何元素的时间复杂度为常数。但是需要对重复元素做特殊处理。 1 class Solution { 2 public: 3 vector twoSum(vector &numbers, int target) { 4 5... 阅读全文
posted @ 2015-02-13 21:32 醉剑客 阅读(208) 评论(0) 推荐(0) 编辑