10x Academy interview question

Two Sum Question from leetcode