Pergunta de entrevista da empresa Bloomberg

i was asked two sum leetcode question