Nureva interview question

Leetcode easy problem involving basic data structures