Amazon interview question

A leetcode medium involving hashmaps