Qualcomm interview question

The two sum problem from Leetcode.