Texas Instruments Interview Question

leetcode: 2 sum question was asked