##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
Hash tables give O(1) average lookup, insert, and delete. Learn frequency counting and two-sum patterns.
Classic introduction to hash maps for tracking username frequencies. Generate unique usernames by appending numbers.
Average vs worst case
Combines prefix sums with sliding window. Teaches frequency-based optimization fundamental to hash table applications.
Frequency counting combined with combinatorics. Use hash maps to find the k-th lexicographic pair efficiently.
Advanced use of multiset to track segment lengths dynamically. Teaches collision handling and efficient updates.
Perfect introduction to polynomial string hashing. Check if string with one character difference exists in a set.
Classic problem for counting distinct substrings using polynomial hashing. Demonstrates why double hashing prevents collisions.
Can be solved with KMP or string hashing. Find substring that appears as prefix, suffix, and middle.
Excellent for mastering rolling hash for suffix-prefix matching. Find longest overlap between consecutive strings.
01-trie problem for maximum XOR queries. Teaches binary representation hashing and greedy bit traversal.
Combines prefix sums with data structures. Hash-based discretization for counting subarrays with sum less than threshold.
Masterclass in binary trie for XOR queries. Handle dynamic insertions/deletions while counting elements satisfying conditions.
Advanced palindrome detection using bidirectional hashing. Compute hashes on both original and reversed strings.
The quintessential hash map problem teaching the fundamental pattern of O(1) lookups while iterating.
Core frequency counting pattern using hash maps to compare character distributions.
Advanced grouping pattern using sorted strings or character counts as hash keys for O(n) grouping.
Brilliant O(n) solution using hash sets to identify sequence starts and extend them.
The canonical prefix sum + hash map problem for counting subarrays in O(n) time.
Combines hash map with doubly linked list for O(1) operations on both access and eviction.
Hash map + dynamic array enabling O(1) random access. Teaches swap-with-last-element trick.
Meet-in-the-middle technique with hash maps reducing O(n^4) to O(n^2).