Question d’entretien chez Bloomberg

i was asked two sum leetcode question