Cadence Design Systems interview question

Two sum first question on leetcode