This problem combines frequency counting with a min-heap for top-k selection. The twist is the tie-breaking rule: when words have the same frequency, the lexicographically smaller one comes first.
You'll learn to write a custom heap comparator that handles sort keys. Amazon's search and product recommendation systems rank items by frequency with tie-breaking rules all the time, so this pattern transfers directly. After solving this, any "top-k with custom ordering" problem will feel straightforward.