class Solution:
# @return a tuple, (index1, index2)
# 8:42
def twoSum(self, num, target):
map = {}
for i in range(len(num)):
if num[i] not in map:
map[target  num[i]] = i + 1
else:
return map[num[i]], i + 1
return 1, 1
Python solution using hash

Haha, @Google, there's a miss " + 1" in the tenth line.
It should be: return map[num[i]] + 1, i + 1
Anyway, this is a terse Python code. Awesome.

@patrick40 this one is easier to understand, save all index of number in a dict for later search through.