New York Times interview question

Two sum leetcode easy question