Loading lesson…
Level 1 · Apprentice0 XP
Vec, HashMap and lazy iterator chains that compile to tight loops.
Step 1 / 6
ProblemCounting words, filtering records and grouping results with index loops is verbose and error-prone.
← → step
Before this: Traits and generics
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Write top_words(text, n) with the HashMap entry API and iterator chains, then a version using fold, and test both. Process a large text file and compare speed with a Python Counter version.