Pregunta de entrevista de Flexport

a leetcode medium question that can be solved via hashmap