Skip to content

Latest commit

 

History

History
8 lines (5 loc) · 683 Bytes

README.md

File metadata and controls

8 lines (5 loc) · 683 Bytes

2-sum

An implementation for two sum Algorithm using hash table and multi-threading

The file "2sum.txt" contains 1 million integers, both positive and negative (there might be some repetitions!).This is your array of integers, with the ithi^{th}ith row of the file specifying the ithi^{th}ith entry of the array.

Your task is to compute the number of target values ttt in the interval [-10000,10000] (inclusive) such that there are distinct numbers x,yx,yx,y in the input file that satisfy x+y=tx+y=tx+y=t. (NOTE: ensuring distinctness requires a one-line addition to the algorithm from lecture.)

Write your numeric answer (an integer between 0 and 20001) in the space provided.