Amazon interview question

The classical 2 sum from leetcode.