Skip to content

Glossary: Coding Interviews in JavaScript

Hash map lookup and counting

Also written: hash map, hash map lookup

Pattern 1: use a `Set` to ask 'have I seen this?' in O(1), or a `Map` to count how many of each item. It costs O(n) time and space.

Where the book teaches it

Related terms

Trading space for timePattern