Pergunta de entrevista da empresa Rivian

Leetcode Hard (more medium if you ask me) hashmap based question