Bloomberg Interview Question

i was asked two sum leetcode question