It looks like the hash map in the illustration is inverted, the keys representing the frequencies and the values representing the elements.
Course: Grokking Coding Interview Patterns in JavaScript - Learn Interactively
Lesson: Solution: Top K Frequent Elements - Grokking Coding Interview Patterns in JavaScript