哈希表:边扫边查 complement

适合展示 Two Sum、存在重复元素、字母异位词这类“查找是否出现过”的题。

2
7
11
15
2index 0
need=2命中

当前 7 需要 2,map.containsKey(2) 为 true。