Texas Instruments interview question

leetcode - 2 sum OOP