Skip to content

Glossary: Coding Interviews in Rust

Hash map lookup and counting

Also written: HashMap, HashSet, hash map, hash set

Using a `HashSet` to answer "seen it?" or a `HashMap` to count, each in O(1) on average. It has no fixed order, so sort before printing.

Where the book teaches it

Related terms

Trading space for timeentry / or_insertBTreeMap