Learning A-Z interview question

Two sum