Curated lists of Leetcode questions group by companies, updated as of May, 2022.
Shout out to fishercoder1534 for the awesome Leetcode repo for solutions.
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
1 | Stone Game VI | Medium | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
3 | Two Sum | Easy | Java, C++, Javascript |
2 | Count Odd Numbers in an Interval Range | Easy | Solution |
2 | Merge Two Sorted Lists | Easy | Solution |
2 | Palindrome Number | Easy | Java, C++ |
1 | Find Subsequence of Length K With the Largest Sum | Easy | Java |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
2 | Minimum ASCII Delete Sum for Two Strings | Medium | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
52 | Two Sum | Easy | Java, C++, Javascript |
19 | Median of Two Sorted Arrays | Hard | Solution, C++ |
16 | Roman to Integer | Easy | Solution |
13 | Reverse Integer | Easy | Solution, C++ |
12 | Maximum Subarray | Easy | Solution |
12 | Contains Duplicate | Easy | Solution |
12 | Longest Palindromic Substring | Medium | Solution |
11 | Merge Two Sorted Lists | Easy | Solution |
11 | Longest Common Prefix | Easy | Solution |
10 | Add Two Numbers | Medium | Solution |
9 | Container With Most Water | Medium | Solution |
9 | 3Sum | Medium | Solution, C++ |
8 | Valid Parentheses | Easy | Solution |
8 | Merge Intervals | Medium | Solution |
8 | First Missing Positive | Hard | Solution |
8 | Best Time to Buy and Sell Stock | Easy | Solution |
7 | Search Insert Position | Easy | Solution |
7 | Search in Rotated Sorted Array | Medium | Solution |
7 | Trapping Rain Water | Hard | Solution |
7 | Product of Array Except Self | Medium | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
10 | Insert Delete GetRandom O(1) | Medium | Solution |
6 | Design Hit Counter | Medium | Solution |
4 | Group Anagrams | Medium | Solution |
3 | Insert Delete GetRandom O(1) - Duplicates allowed | Hard | Solution |
3 | Valid Anagram | Easy | Solution |
2 | Optimal Account Balancing | Hard | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
14 | Palindrome Pairs | Hard | Solution |
14 | Alien Dictionary | nan | Solution |
9 | Flatten 2D Vector | Medium | Solution |
7 | Smallest Common Region | Medium | Solution |
6 | Pour Water | Medium | Solution |
6 | Minimum Window Substring | Hard | Solution |
5 | Combination Sum | Medium | Solution |
4 | Flatten Nested List Iterator | Medium | Solution |
3 | Design Circular Queue | Medium | Solution |
3 | Fraction to Recurring Decimal | Medium | Solution |
2 | Find the Smallest Divisor Given a Threshold | nan | Solution |
2 | Tag Validator | Hard | Solution |
2 | Intersection of Two Linked Lists | Easy | Solution |
1 | Pyramid Transition Matrix | Medium | Solution |
1 | Mini Parser | Medium | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
1 | N-Repeated Element in Size 2N Array | Easy | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
8 | Increasing Decreasing String | Easy | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
3 | H-Index | Medium | Solution |
2 | Best Time to Buy and Sell Stock | Easy | Solution |
2 | Group Anagrams | Medium | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
1 | Path Sum IV | Medium | Solution |
1 | Split Concatenated Strings | Medium | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
1 | Number Of Rectangles That Can Form The Largest Square | Easy | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
117 | Two Sum | Easy | Java, C++, Javascript |
117 | LRU Cache | Hard | Solution |
103 | Number of Islands | Medium | Solution |
87 | Merge Intervals | Medium | Solution |
68 | Search Suggestions System | Medium | Solution |
56 | Best Time to Buy and Sell Stock | Easy | Solution |
51 | Group Anagrams | Medium | Solution |
50 | Analyze User Website Visit Pattern | Medium | Solution |
49 | Longest Substring Without Repeating Characters | Medium | Solution, C++ |
49 | K Closest Points to Origin | Easy | Solution |
48 | Meeting Rooms II | Medium | Solution |
47 | Merge k Sorted Lists | Hard | Solution |
45 | Trapping Rain Water | Hard | Solution |
44 | 3Sum | Medium | Solution, C++ |
43 | Valid Parentheses | Easy | Solution |
41 | Word Ladder | Hard | Solution |
40 | Median of Two Sorted Arrays | Hard | Solution, C++ |
36 | Add Two Numbers | Medium | Solution |
36 | Word Search | Medium | Solution |
35 | Maximum Subarray | Easy | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
3 | Reorder Routes to Make All Paths Lead to the City Zero | Medium | Solution |
3 | Valid Palindrome | Easy | Solution |
3 | Two Sum | Easy | Java, C++, Javascript |
2 | Reducing Dishes | Hard | Solution |
2 | 3Sum | Medium | Solution, C++ |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
40 | Two Sum | Easy | Java, C++, Javascript |
20 | LRU Cache | Hard | Solution |
19 | Add Two Numbers | Medium | Solution |
18 | Merge Intervals | Medium | Solution |
17 | Maximum Subarray | Easy | Solution |
16 | Longest Substring Without Repeating Characters | Medium | Solution, C++ |
15 | Median of Two Sorted Arrays | Hard | Solution, C++ |
14 | Longest Common Prefix | Easy | Solution |
13 | Roman to Integer | Easy | Solution |
11 | Spiral Matrix | Medium | Solution |
11 | Group Anagrams | Medium | Solution |
11 | Number of Islands | Medium | Solution |
10 | Word Break | Medium | Solution |
10 | Product of Array Except Self | Medium | Solution |
10 | 3Sum | Medium | Solution, C++ |
9 | Generate Parentheses | Medium | Solution |
8 | Rotate Image | Medium | Solution |
8 | Move Zeroes | Easy | Solution |
8 | Best Time to Buy and Sell Stock | Easy | Solution |
8 | Merge k Sorted Lists | Hard | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
4 | Maximum Length of Subarray With Positive Product | Medium | Solution |
2 | Broken Calculator | Medium | Solution |
2 | Minimum Size Subarray Sum | Medium | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
3 | Valid Parentheses | Easy | Solution |
2 | Compare Version Numbers | Easy | Solution |
2 | Restore IP Addresses | Medium | Solution |
1 | Construct String With Repeat Limit | Medium | Java |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
13 | Product of Array Except Self | Medium | Solution |
5 | K Closest Points to Origin | Easy | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
4 | Degree of an Array | Easy | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
18 | Rank Teams by Votes | Medium | Solution |
10 | Logger Rate Limiter | Easy | Solution |
4 | Lemonade Change | Easy | Solution |
3 | Design Snake Game | Medium | Solution |
2 | Greatest Common Divisor of Strings | Easy | Solution |
2 | Single Number | Easy | Solution |
2 | Best Time to Buy and Sell Stock | Easy | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
1 | Out of Boundary Paths | Hard | Solution |
1 | Zuma Game | Hard | Solution |
1 | Arithmetic Slices II - Subsequence | Hard | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
2 | Valid Parentheses | Easy | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
6 | Group Anagrams | Medium | Solution |
2 | Evaluate Division | Medium | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
64 | Design Underground System | Medium | Solution |
33 | Number of Islands | Medium | Solution |
33 | Decode String | Medium | Solution |
28 | Flatten a Multilevel Doubly Linked List | Medium | Solution |
26 | Remove All Adjacent Duplicates in String II | Medium | Solution |
23 | Insert Delete GetRandom O(1) | Medium | Solution |
23 | Longest Substring Without Repeating Characters | Medium | Solution, C++ |
20 | Merge Intervals | Medium | Solution |
20 | Meeting Rooms II | Medium | Solution |
20 | Design an Ordered Stream | Easy | Solution |
19 | LRU Cache | Hard | Solution |
16 | Two Sum | Easy | Java, C++, Javascript |
16 | Add Two Numbers | Medium | Solution |
15 | Trapping Rain Water | Hard | Solution |
14 | Validate Binary Search Tree | Medium | Solution |
14 | Two City Scheduling | Easy | Solution |
14 | Valid Parentheses | Easy | Solution |
14 | Word Search | Medium | Solution |
13 | First Unique Character in a String | Easy | Solution |
12 | Best Time to Buy and Sell Stock | Easy | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
5 | Check if All Characters Have Equal Number of Occurrences | Easy | Solution |
3 | Reverse Words in a String III | Easy | Solution |
3 | Word Pattern | Easy | Solution |
2 | Subarray Sum Equals K | Medium | Solution |
2 | Word Pattern II | Hard | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
3 | Least Number of Unique Integers after K Removals | Medium | Solution |
3 | Backspace String Compare | Easy | Solution |
3 | Additive Number | Medium | Solution |
2 | Integer to English Words | Hard | Solution |
2 | Sliding Window Maximum | Hard | Solution |
2 | Valid Parentheses | Easy | Solution |
1 | Two Out of Three | Easy | Java |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
12 | Number of 1 Bits | Easy | Solution |
4 | Word Ladder II | Hard | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
8 | Merge k Sorted Lists | Hard | Solution |
6 | Number of Islands | Medium | Solution |
6 | Search in Rotated Sorted Array | Medium | Solution |
6 | Binary Tree Maximum Path Sum | Hard | Solution |
5 | LRU Cache | Hard | Solution |
4 | The Maze | Medium | Solution |
4 | Basic Calculator II | Medium | Solution |
4 | Sliding Window Maximum | Hard | Solution |
4 | The Number of Weak Characters in the Game | Medium | Solution |
3 | Best Time to Buy and Sell Stock II | Easy | Solution |
3 | Course Schedule II | Medium | Solution |
3 | Longest Valid Parentheses | Hard | Solution |
3 | Combination Sum | Medium | Solution |
3 | N-Queens | Hard | Solution |
3 | Maximum Subarray | Easy | Solution |
3 | Best Time to Buy and Sell Stock | Easy | Solution |
3 | Sort List | Medium | Solution |
3 | Closest Dessert Cost | Medium | Solution |
3 | 3Sum | Medium | Solution, C++ |
3 | Basic Calculator | Hard | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
3 | Pairs of Songs With Total Durations Divisible by 60 | Easy | Solution |
3 | Daily Temperatures | Medium | Solution |
3 | Generate Parentheses | Medium | Solution |
2 | Sort Array by Increasing Frequency | Easy | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
1 | Divide a String Into Groups of Size k | Easy | Java |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
18 | License Key Formatting | Medium | Solution |
14 | Count Primes | Easy | Solution |
13 | Reverse Nodes in k-Group | Hard | Solution |
4 | Best Time to Buy and Sell Stock | Easy | Solution |
3 | Candy Crush | Medium | Solution |
3 | Integer to Roman | Medium | Solution |
2 | Rotating the Box | Medium | Solution |
2 | Restore the Array From Adjacent Pairs | Medium | Solution |
2 | Add Two Numbers | Medium | Solution |
1 | Four Divisors | Medium | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
1 | Maximum Erasure Value | Medium | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
16 | Word Search II | Hard | Solution |
16 | Rotate Image | Medium | Solution |
11 | Maximum Subarray | Easy | Solution |
11 | Expressive Words | Medium | Solution |
9 | Decode Ways | Medium | Solution |
8 | Validate IP Address | Medium | Solution |
8 | Decode String | Medium | Solution |
6 | House Robber | Easy | Solution |
6 | Maximum Difference Between Increasing Elements | Easy | Java |
5 | Valid Parentheses | Easy | Solution |
4 | Number of 1 Bits | Easy | Solution |
3 | Top K Frequent Elements | Medium | Solution |
3 | Beautiful Arrangement | Medium | Solution |
3 | Unique Paths II | Medium | Solution |
2 | Coin Change 2 | Medium | Solution |
2 | First Bad Version | Easy | Solution |
2 | Maximum Population Year | Easy | Solution |
2 | Best Time to Buy and Sell Stock | Easy | Solution |
2 | Find Pivot Index | Easy | Solution |
2 | Merge Intervals | Medium | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
8 | Pairs of Songs With Total Durations Divisible by 60 | Easy | Solution |
5 | Range Addition | Medium | Solution |
4 | Sliding Window Maximum | Hard | Solution |
2 | Transpose Matrix | Easy | Solution |
2 | Best Time to Buy and Sell Stock IV | Hard | Solution |
2 | Trapping Rain Water | Hard | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
1 | Find All Groups of Farmland | Medium | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
2 | Largest BST Subtree | Medium | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
1 | Count Vowel Substrings of a String | Easy | Java |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
2 | Rank Teams by Votes | Medium | Solution |
2 | Wildcard Matching | Hard | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
9 | Unique Paths II | Medium | Solution |
5 | Valid Sudoku | Medium | Solution, Javascript |
3 | Synonymous Sentences | Medium | Solution |
3 | The Skyline Problem | Hard | Solution |
2 | Product of the Last K Numbers | Medium | Solution |
2 | Car Pooling | Medium | Solution |
2 | Decode String | Medium | Solution |
2 | Palindrome Permutation II | Medium | Solution |
2 | Number of Islands | Medium | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
3 | Freedom Trail | Hard | Solution |
2 | Sliding Window Maximum | Hard | Solution |
1 | Number of Substrings Containing All Three Characters | Medium | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
1 | Three Consecutive Odds | Easy | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
4 | Reorder Routes to Make All Paths Lead to the City Zero | Medium | Solution |
1 | Counting Elements | Easy | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
9 | Design Hit Counter | Medium | Solution |
2 | Sparse Matrix Multiplication | Medium | Solution |
2 | First Missing Positive | Hard | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
2 | Valid Parentheses | Easy | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
3 | Two Sum | Easy | Java, C++, Javascript |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
1 | The Time When the Network Becomes Idle | Medium | Java |
1 | Minimum Operations to Make the Array Increasing | Easy | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
1 | Find the Winner of an Array Game | Medium | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
5 | Number of Islands | Medium | Solution |
3 | Maximum Subarray | Easy | Solution |
2 | Implement Trie II (Prefix Tree) | Medium | Solution |
2 | Rectangle Overlap | Easy | Solution |
2 | Minesweeper | Medium | Solution |
2 | LRU Cache | Hard | Solution |
2 | Best Time to Buy and Sell Stock | Easy | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
18 | Binary Tree Maximum Path Sum | Hard | Solution |
13 | Buddy Strings | Easy | Solution |
11 | Walls and Gates | Medium | Solution |
7 | Minimum Number of Steps to Make Two Strings Anagram | Easy | Solution |
7 | Asteroid Collision | Medium | Solution |
7 | Serialize and Deserialize Binary Tree | Hard | Solution |
6 | Basic Calculator | Hard | Solution |
5 | Shortest Distance from All Buildings | Hard | Solution |
5 | Longest Common Subsequence | Medium | Solution |
5 | Number of Islands | Medium | Solution |
4 | Integer to English Words | Hard | Solution |
4 | Sudoku Solver | Hard | Solution |
4 | Design In-Memory File System | Hard | Solution |
4 | Car Pooling | Medium | Solution |
3 | Path Sum III | Easy | Solution |
3 | Jump Game | Medium | Solution |
3 | Jump Game II | Hard | Solution |
3 | Find Nearest Point That Has the Same X or Y Coordinate | Easy | Solution |
2 | K-diff Pairs in an Array | Easy | Solution |
2 | Subarray Sum Equals K | Medium | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
1 | Set Intersection Size At Least Two | Hard | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
6 | Find Duplicate File in System | Medium | Solution |
5 | Game of Life | Medium | Solution |
2 | Max Area of Island | Medium | Solution |
2 | Design Phone Directory | Medium | Solution |
2 | Number of Islands | Medium | Solution |
1 | Seat Reservation Manager | Medium | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
1 | Maximize Sum Of Array After K Negations | Easy | Solution |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
2 | Maximum Number of Coins You Can Get | Medium | Solution |
2 | Max Sum of Rectangle No Larger Than K | Hard | Solution |
1 | Stone Game VII | Medium | Solution |
1 | Ways to Make a Fair Array | Medium | Javascript |
[back to top]
Occurence | Problem | Difficulty | Solution |
---|---|---|---|
2 | Minimum Number of People to Teach | Medium | Solution |
[back to top]