FanCraze interview question

Two sum of leetcode question