Hashmaps give you average lookup, but hard problems rarely ask you to just use a hashmap. They combine hashmaps with sliding windows, prefix sums, coordinate compression, or custom hash functions.
Your challenge in hard hashmap problems is identifying what to store as keys and values. The right mapping transforms a brute force or solution into .