Download the Cheat Sheet
Download the Cheat Sheet
1. Two-Pointer Technique
Use When:
- You're trying to find pairs or triplets with a specific condition (e.g., sum = target).
Common Problems:
- Two Sum II
- 3Sum, 4Sum
- Remove Duplicates
2. Sliding Window
Use When:
Common Problems:
- Maximum Subarray
- Permutation in String
Use When:
Common Problems:
- Two Sum
- Group Anagrams
Array Problem Solving Techniques Cheat Sheet
- Contains Duplicate
Use When:
Common Problems:
5. Binary Search
Use When:
Common Problems:
6. Greedy Algorithms
Use When:
Common Problems:
- Jump Game
- Gas Station
- Burst Balloons
Array Problem Solving Techniques Cheat Sheet
- Candy Distribution
7. Sorting
Use When:
Common Problems:
- Merge Intervals
- Meeting Rooms
- Sort Colors
8. Stack/Monotonic Stack
Use When:
Common Problems:
- Daily Temperatures
9. Backtracking / DFS
Use When:
Common Problems:
- Subsets
- Combination Sum
- Permutations
Array Problem Solving Techniques Cheat Sheet
- Word Search
Use When:
Common Problems:
- House Robber
- Maximum Subarray
Use When:
Common Problems:
- Redundant Connection
- Accounts Merge
Use When:
Common Problems:
- Maximum Subarray