code for 3sum