X interview question

Tweet Counts Per Frequency. Leetcode medium