American Express interview question

Q: Two sum question from leetcode