Infosys interview question

Two sum problem