Bloomberg Interview Question

They asked a question which was a variation of two sum from leetcode