SSENSE interview question

easy leetcode question using hashmap