Slug: hash-entry-01 · Paired reading: Chapters 14 and 16
Prompt
fn frequencies(words: &[&str]) -> HashMap<String, usize> — count with
a single lookup per word via entry(...).or_default() / += 1.
Do not get then insert.
The curriculum, drills, tutor, and interviewer mode are for readers of Ace the Rust Interview. The code is printed in the Preface (Companion site access).
Don’t have the book yet? The landing page stays open — purchase unlocks this gym.
intermediate · order 91
Slug: hash-entry-01 · Paired reading: Chapters 14 and 16
fn frequencies(words: &[&str]) -> HashMap<String, usize> — count with
a single lookup per word via entry(...).or_default() / += 1.
Do not get then insert.