Test interview question

Two sum from leetcode platform.