Rivian interview question

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