adding algorithm for 3Sum