Pregunta de entrevista de eBay

It is the Two sum leetcode question.