Need to find, count or group things fast? Trade memory for speed with a hash map or set.
- Day 1📘 pattern1. Two Sum (opens LeetCode in a new tab)
Idea: Store each number's index in a map; look up target minus current.
- Day 1📝 homework217. Contains Duplicate (opens LeetCode in a new tab)
Idea: A set tells you instantly if you have seen a value.
Easy - Day 2🎥 video242. Valid Anagram (opens LeetCode in a new tab)
Idea: Count letters in both strings; the counts must match.
Easy - Day 2📝 homework49. Group Anagrams (opens LeetCode in a new tab)
Idea: Sorted word (or letter counts) as the map key.
🔥 Interview favouriteMedium - Day 3🎥 video169. Majority Element (opens LeetCode in a new tab)
Idea: Boyer–Moore voting: a candidate and a counter.
Easy - Day 3📝 homework189. Rotate Array (opens LeetCode in a new tab)
Idea: k %= n, then reverse all, reverse first k, reverse the rest.
Medium - Day 4🎥 video238. Product of Array Except Self (opens LeetCode in a new tab)
Idea: Prefix product from the left times suffix product from the right.
🔥 Interview favouriteMedium - Day 4📝 homework347. Top K Frequent Elements (opens LeetCode in a new tab)
Idea: Count, then bucket by frequency instead of sorting.
Medium - Day 5🎥 video128. Longest Consecutive Sequence (opens LeetCode in a new tab)
Idea: Only start counting from numbers whose n−1 is not in the set.
Medium - Day 5📝 homework36. Valid Sudoku (opens LeetCode in a new tab)
Idea: One set per row, column and 3×3 box.
Medium