Amazon Interview Question

Modified version of 2sum