Enter your book access code

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

entry API without double lookup

hash-entry-01Related book chapters: 14, 16 (optional — this page is complete on its own)entry-API

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.