New York Times Interview Question

Two sum leetcode easy question