Texas Instruments interview question

leetcode: 2 sum question was asked