Fintech interview question

Two sum leetcode question, easy