Deloitte Interview Question

Solve two sum leetcode problem