Two Pointers:
- Two/Three/Four Sum:
- Two Sum *! | Two Sum II – Input array is Sorted ^ |
- Two Sum III – Data structure design | Two Sum IV – Input is a BST |
- 3Sum Simp *! | 3Sum Adv *! | 3Sum Closest | 3Sum Smaller |
- 4Sum | 4Sum II ! | | Count subsets
- Read and Write pointers:
- Other:
Subarray & Subsequences in Array:
- Subarray vs Subsequence for Arrays | Sum of all Subarrays for Arrays |
- Sum of all subsequences for Arrays | Maximum Subarray Sum * |
- Maximum Size Subarray Sum Equals k | Minimum Size Subarray Sum |
- Contiguous Array | Longest subarray with all elements same |
Sliding Window:
- Sliding window Template | Maximum Sum Subarray of Size K |
- Smallest Subarray With a Greater Sum | Birthday Chocolate | Fruit Into Baskets
- Max Consecutive Ones III
Prefix Sum + Suffix Sum: leetcode slugs | g4g | g4gvc
- Product of Array Except Self *! | Subarray Sum Equals K |
- Random Pick with Weight | Sum Of Infinite Array | Continuous Subarray Sum
- XOR Query | Count all sub-arrays having sum divisible by k
Cyclic Sort:
- Cyclic Sort | Missing Number *! | Find all Missing Numbers |
- Find the Duplicate Number * | Find All Duplicates in an Array | Find the Corrupt Pair |
- First Missing Positive ! | Find All Numbers Disappeared in an Array
Intervals / Meeting Rooms:
- Merge Intervals * | Insert Interval * | Interval List Intersections |
- Non-overlapping Intervals * | Meeting Rooms * |
- Maximum Intervals Overlap
Ranges: Summary Ranges | Missing Ranges !
Majority Element: Majority Element ! | Majority Element II
Common numbers in Sorted Array:
Shortest Word Distance:
Max Consecutive Ones:
- Max Consecutive Ones | Max Consecutive Ones II |
Peaks and Valley: Best Time to Buy and Sell Stock ^! | Best Time to Buy and Sell Stock II !
Merge: Merge Sorted Array ! Shuffle: Shuffle an Array !
Rotate Array: Rotate Array | Rotate Array II
Integers as Array:
Misc:
- Running Sum of 1d Array | Find Pivot Index
- Largest Number At Least Twice of Others | Queue Reconstruction by Height
- Array Partition I | Magic Index | Smallest Difference | Next Permutation
Difficult Medium/Hard:
- Trapping Rain Water ^! | Container With Most Water *!
- Sliding Window Maximum ^! | Longest Consecutive Sequence *!
- Count and Say ! | Increasing Triplet Subsequence ! | Task Scheduler ^
- Median of Two Sorted Arrays ! | Median of Two Sorted Arrays II !
- Find the Celebrity ! | The Skyline Problem ! | First Missing Positive !
- Gas Station ! | Largest Rectangle in Histogram ! | Max Points on a Line !
- Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit
- Find Numbers with Even Number of Digits