Domanda di colloquio di Flexport

a leetcode medium question that can be solved via hashmap