You are viewing a single comment's thread. Return to all comments →
Mine looks similar but I chose Python3. It should work for many "find pair of sum" problems, not just this special problem.
hs = { } for i in range(len(a)): if a[i] in hs: print(hs[a[i]], i + 1) break hs[m - a[i]] = i + 1
Hash Tables: Ice Cream Parlor
You are viewing a single comment's thread. Return to all comments →
Mine looks similar but I chose Python3. It should work for many "find pair of sum" problems, not just this special problem.