Arrays & Hashing
Overview
Arrays & Hashing is the first section of the NeetCode 150 and the most load-bearing: a hash map + array reasoning pattern appears in most of the remaining categories. Master these nine and you’ve unlocked roughly 30% of the full list’s problem-solving surface.
Problems
- 217. Contains Duplicate (Easy)
- 242. Valid Anagram (Easy)
- 1. Two Sum (Easy)
- 49. Group Anagrams (Medium)
- 347. Top K Frequent Elements (Medium)
- 238. Product of Array Except Self (Medium)
- 36. Valid Sudoku (Medium)
- 271. Encode and Decode Strings (Medium) (LC premium, also appears as #659)
- 128. Longest Consecutive Sequence (Medium)
Bonus problems (same pattern, outside NeetCode 150):
- 205. Isomorphic Strings (Easy)
- 228. Summary Ranges (Easy)
- 303. Range Sum Query - Immutable (Easy)
- 349. Intersection of Two Arrays (Easy)
- 387. First Unique Character in a String (Easy)
- 454. 4Sum II (Medium)
- 459. Repeated Substring Pattern (Easy)
- 1010. Pairs of Songs With Total Durations Divisible by 60 (Medium)
- 1071. Greatest Common Divisor of Strings (Easy)
Key patterns unlocked here
- Hash set for dedup / membership: Contains Duplicate, Longest Consecutive Sequence.
- Frequency counting: Valid Anagram, Group Anagrams, Top K Frequent Elements.
- Complement lookup (one-pass hash): Two Sum, and dozens of variants downstream.
- Prefix / suffix products or sums: Product of Array Except Self.
- Encoding state into a hashable key: Group Anagrams (char-count tuple), Valid Sudoku (row/col/box keys).
- Prefix sums for range queries: Range Sum Query.
- Range boundaries in a sorted scan: Summary Ranges.
- Modular arithmetic for pair counting: Pairs of Songs Divisible by 60.