Asked about The high-frequency patterns

When do you reach for a hash map?

An answer that works

Whenever the question involves lookup, counting, grouping or duplicate detection. It turns a scan into a constant-time check, which is usually what converts a quadratic solution to a linear one.

Reading an answer is not being able to give one. The section that teaches this is The high-frequency patterns, 16 hours of Data structures & algorithms.

Learn this properly