This repository contains a categorized list of LeetCode problems, organized by problem-solving techniques. Use this cheat sheet as a quick reference for different problem types and corresponding LeetCode problems.
Used for problems involving finding the k-th smallest/largest elements or sorting.
- 215. Kth Largest Element in an Array
- 347. Top K Frequent Elements
- 378. Kth Smallest Element in a Sorted Matrix
- 75. Sort Colors
- Merge Intervals
Involves problems where two pointers or a two-pointer technique is used to solve linked list problems.
- 21. Merge Two Sorted Lists
- 19. Remove Nth Node From End of List
- Linked List Cycle
- Intersection of Two Linked Lists
- Reverse Linked List
Typically involves optimizing a value while managing two criteria simultaneously with a sorted array.
- 948. Bag of Tokens
- Characteristics: Maximization/Minimization, Sorted Input, Dynamic Adjustment, Resource Management.
Suitable for problems where constraints are small and brute force is fast enough.
- Permutations
- Subset
- Letter Combinations of a Phone Number
- Generate Parentheses
- N-Queens
Used when brute force is too slow, but constraints are small.
- House Robber
- Longest Increasing Subsequence
- Unique Paths
- Partition Equal Subset Sum
- Longest Palindromic Substring
Deals with problems involving subarrays or substrings with sums or additive operations.
- Subarray Sum Equals K
- Find Pivot Index
- Range Sum Query - Immutable
- Maximum Sum of Two Non-Overlapping Subarrays
- Continuous Subarray Sum
Involves problems with subarrays or substrings where the sliding window technique is used but does not involve additive sums.
- Minimum Size Subarray Sum
- Longest Substring Without Repeating Characters
- Sliding Window Maximum
- Longest Repeating Character Replacement
- Fruit Into Baskets
Used for problems involving calculating max/min with a monotonic condition.
- Find Minimum in Rotated Sorted Array
- Search in Rotated Sorted Array
- Median of Two Sorted Arrays
- Find Peak Element
- H-Index II
For problems where dynamic programming is used to calculate max/min but without a monotonic condition.
- Maximum Subarray
- Coin Change
- Longest Common Subsequence
- Minimum Path Sum
- Knapsack Problem
For problems that can be split into smaller sub-problems.
- Climbing Stairs
- Edit Distance
- Fibonacci Number
- 0/1 Knapsack
- Longest Palindromic Subsequence
Used when a problem can be solved with a greedy approach to calculate the answer.
- Jump Game
- Gas Station
- Candy
- Best Time to Buy and Sell Stock II
- Minimum Number of Arrows to Burst Balloons
For problems asking for the number of ways and brute force is efficient enough.
- Combination Sum
- Letter Combinations of a Phone Number
- Palindrome Partitioning
- Word Search
- Combinations
Used when asking for the number of ways and brute force is not efficient enough.
- Unique Paths
- Target Sum
- Coin Change 2
- Combination Sum IV
- Number of Longest Increasing Subsequence
- Browse Categories: Navigate through the categories to find problems related to specific techniques.
- Review Problems: Each problem is listed with its LeetCode problem number and description.
- Clone or Fork: Clone the repository to your local machine or fork it for your personal use.
Contributions are welcome! If you have additional problems or improvements:
- Add the problem to the appropriate category.
- Update this README file with new problems and categories.
- Create a pull request with your changes.
This repository is licensed under the MIT License. See the LICENSE file for details.
Happy coding!