Bloomberg Interview Question

modified two sum leetcode and then time complexity and space