TikTok interview question

A medium leetcode about Hashmap and Rolling Window.