DSA Master › Topic 1

Arrays & Hashing

Most interview problems start here. A hash map turns "have I seen this before?" from an O(n) scan into an O(1) lookup, which is how you get most O(n²) brute-force solutions down to O(n).

Concepts

How to recognise it

Common pitfalls

Problems

  1. Two Sum (Easy)
  2. Contains Duplicate (Easy)
  3. Valid Anagram (Easy)
  4. Group Anagrams (Medium)
  5. Top K Frequent Elements (Medium)
  6. Product of Array Except Self (Medium)
  7. Longest Consecutive Sequence (Medium)
  8. Majority Element (Easy)
  9. Subarray Sum Equals K (Medium)
  10. First Missing Positive (Hard)
  11. Insert Delete GetRandom O(1) (Medium)
  12. Longest Harmonious Subsequence (Easy)