Glossary: Coding Interviews in Go
Hash map lookup and counting
Also written: hash map, map, pattern 1, set
Using a map to remember what you've seen or to count items, in O(1) per lookup on average. Go has no set type, so a set is a `map[T]struct{}`.
Glossary: Coding Interviews in Go
Also written: hash map, map, pattern 1, set
Using a map to remember what you've seen or to count items, in O(1) per lookup on average. Go has no set type, so a set is a `map[T]struct{}`.