eBay interview question

It is the Two sum leetcode question.