Amazon interview question

Modified version of 2sum