Infosys Interview Question

Two sum problem