Skip to content

sungho-joo/leetcode2github

 
 

Repository files navigation

Table of Contents

Solution Summary
Difficulty
Categories

Solution Summary

ID Problem Leetcode ID Categories Difficulty
1 429
2 116
3 297
4 430
5 284
6 Get Maximum in Generated Array 1646 Array, Dynamic Programming, Simulation Easy
7 Minimum Deletions to Make Character Frequencies Unique 1647 String, Greedy, Sorting Medium
8 Sell Diminishing-Valued Colored Balls 1648 Array, Math, Binary Search, Greedy, Sorting, Heap (Priority Queue) Medium
9 Design an Ordered Stream 1656 Array, Hash Table, Design, Data Stream Easy
10 Determine if Two Strings Are Close 1657 Hash Table, String, Sorting Medium
11 Check If Two String Arrays are Equivalent 1662 Array, String Easy
12 Smallest String With A Given Numeric Value 1663 String, Greedy Medium
13 Richest Customer Wealth 1672 Array, Matrix Easy
14 Find the Most Competitive Subsequence 1673 Array, Stack, Greedy, Monotonic Stack Medium
15 Minimum Moves to Make Array Complementary 1674 Array, Hash Table, Prefix Sum Medium
16 Count of Matches in Tournament 1688 Math, Simulation Easy
17 Partitioning Into Minimum Number Of Deci-Binary Numbers 1689 String, Greedy Medium
18 Determine if String Halves Are Alike 1704 String, Counting Easy
19 Maximum Number of Eaten Apples 1705 Array, Greedy, Heap (Priority Queue) Medium
20 Where Will the Ball Fall 1706 Array, Dynamic Programming, Depth-First Search, Matrix, Simulation Medium
21 Maximum Units on a Truck 1710 Array, Greedy, Sorting Easy
22 Count Good Meals 1711 Array, Hash Table Medium
23 Decode XORed Array 1720 Array, Bit Manipulation Easy
24 Swapping Nodes in a Linked List 1721 Linked List, Two Pointers Medium
25 Minimize Hamming Distance After Swap Operations 1722 Array, Depth-First Search, Union Find Medium
26 Find Minimum Time to Finish All Jobs 1723 Array, Dynamic Programming, Backtracking, Bit Manipulation, Bitmask Hard
27 Number Of Rectangles That Can Form The Largest Square 1725 Array Easy
28 Tuple with Same Product 1726 Array, Hash Table Medium
29 Largest Submatrix With Rearrangements 1727 Array, Greedy, Sorting, Matrix Medium
30 Latest Time by Replacing Hidden Digits 1736 String, Greedy Easy
31 Change Minimum Characters to Satisfy One of Three Conditions 1737 Hash Table, String, Counting, Prefix Sum Medium
32 Find Kth Largest XOR Coordinate Value 1738 Array, Divide and Conquer, Bit Manipulation, Heap (Priority Queue), Matrix, Prefix Sum, Quickselect Medium
33 Building Boxes 1739 Math, Binary Search, Greedy Hard
34 Maximum Number of Balls in a Box 1742 Hash Table, Math, Counting Easy
35 Restore the Array From Adjacent Pairs 1743 Array, Hash Table Medium
36 Check if Array Is Sorted and Rotated 1752 Array Easy
37 Minimum Changes To Make Alternating Binary String 1758 String Easy
38 Count Number of Homogenous Substrings 1759 Math, String Medium
39 Minimum Degree of a Connected Trio in a Graph 1761 Graph Hard
40 Merge Strings Alternately 1768 Two Pointers, String Easy
41 Minimum Number of Operations to Move All Balls to Each Box 1769 Array, String Medium
42 Maximum Score from Performing Multiplication Operations 1770 Array, Dynamic Programming Medium
43 Maximize Palindrome Length From Subsequences 1771 String, Dynamic Programming Hard
44 Check if Binary String Has at Most One Segment of Ones 1784 String Easy
45 Check if One String Swap Can Make Strings Equal 1790 Hash Table, String, Counting Easy
46 Find Center of Star Graph 1791 Graph Easy
47 Maximum Average Pass Ratio 1792 Array, Greedy, Heap (Priority Queue) Medium
48 Maximum Ascending Subarray Sum 1800 Array Easy
49 Number of Orders in the Backlog 1801 Array, Heap (Priority Queue), Simulation Medium
50 Number of Different Integers in a String 1805 Hash Table, String Easy
51 Truncate Sentence 1816 Array, String Easy
52 Finding the Users Active Minutes 1817 Array, Hash Table Medium
53 Minimum Absolute Sum Difference 1818 Array, Binary Search, Sorting, Ordered Set Medium
54 Number of Different Subsequences GCDs 1819 Array, Math, Counting, Number Theory Hard
55 Sign of the Product of an Array 1822 Array, Math Easy
56 Find the Winner of the Circular Game 1823 Array, Math, Recursion, Queue, Simulation Medium
57 Minimum Sideway Jumps 1824 Array, Dynamic Programming, Greedy Medium
58 Finding MK Average 1825 Design, Queue, Heap (Priority Queue), Ordered Set Hard
59 Maximum Ice Cream Bars 1833 Array, Greedy, Sorting Medium
60 Single-Threaded CPU 1834 Array, Sorting, Heap (Priority Queue) Medium
61 Find XOR Sum of All Pairs Bitwise AND 1835 Array, Math, Bit Manipulation Hard
62 Check if the Sentence Is Pangram 1832 Hash Table, String Easy
63 Frequency of the Most Frequent Element 1838 Array, Binary Search, Greedy, Sliding Window, Sorting, Prefix Sum Medium
64 Sum of Digits in Base K 1837 Math Easy
65 Longest Substring Of All Vowels in Order 1839 String, Sliding Window Medium
66 Maximum Building Height 1840 Array, Math Hard
67 Minimum Interval to Include Each Query 1851 Array, Binary Search, Line Sweep, Sorting, Heap (Priority Queue) Hard
68 Minimum Number of Swaps to Make the Binary String Alternating 1864 String, Greedy Medium
69 Finding Pairs With a Certain Sum 1865 Array, Hash Table, Design Medium
70 Minimum Distance to the Target Element 1848 Array Easy
71 Splitting a String Into Descending Consecutive Values 1849 String, Backtracking Medium
72 Next Permutation 31 Array, Two Pointers Medium
73 Minimum Adjacent Swaps to Reach the Kth Smallest Number 1850 Two Pointers, String, Greedy Medium
74 Maximum Distance Between a Pair of Values 1855 Array, Two Pointers, Binary Search, Greedy Medium
75 Maximum Subarray Min-Product 1856 Array, Stack, Monotonic Stack, Prefix Sum Medium
76 Longer Contiguous Segments of Ones than Zeros 1869 String Easy
77 Minimum Speed to Arrive on Time 1870 Array, Binary Search Medium
78 Jump Game VII 1871 Two Pointers, String, Prefix Sum Medium
79 Largest Color Value in a Directed Graph 1857 Hash Table, Dynamic Programming, Graph, Topological Sort, Memoization, Counting Hard
80 Maximum Population Year 1854 Array, Counting Easy
81 Process Tasks Using Servers 1882 Array, Heap (Priority Queue) Medium
82 Sum of All Subset XOR Totals 1863 Array, Backtracking, Bit Manipulation Easy
83 Number of Ways to Rearrange Sticks With K Sticks Visible 1866 Math, Dynamic Programming, Combinatorics Hard
84 Determine Whether Matrix Can Be Obtained By Rotation 1886 Array, Matrix Easy
85 Stone Game VIII 1872 Array, Math, Dynamic Programming, Prefix Sum, Game Theory Hard
86 Redistribute Characters to Make All Strings Equal 1897 Hash Table, String, Counting Easy
87 Merge Triplets to Form Target Triplet 1899 Array, Greedy Medium
88 Check if Word Equals Summation of Two Words 1880 String Easy
89 Maximum Value after Insertion 1881 String, Greedy Medium
90 Minimum Skips to Arrive at Meeting On Time 1883 Array, Dynamic Programming Hard
91 Largest Odd Number in String 1903 Math, String, Greedy Easy
92 Count Sub Islands 1905 Array, Depth-First Search, Breadth-First Search, Union Find, Matrix Medium
93 Minimum Absolute Difference Queries 1906 Array, Hash Table Medium
94 Reduction Operations to Make the Array Elements Equal 1887 Array, Sorting Medium
95 Minimum Space Wasted From Packaging 1889 Array, Binary Search, Sorting, Prefix Sum Hard
96 Minimum Number of Flips to Make the Binary String Alternating 1888 String, Greedy Medium
97 Maximum Product Difference Between Two Pairs 1913 Array, Sorting Easy
98 Cyclically Rotating a Grid 1914 Array, Matrix, Simulation Medium
99 Number of Wonderful Substrings 1915 Hash Table, String, Bit Manipulation, Prefix Sum Medium
100 Count Ways to Build Rooms in an Ant Colony 1916 Math, Dynamic Programming, Tree, Graph, Topological Sort, Combinatorics Hard
101 Maximum Number of Removable Characters 1898 Array, String, Binary Search Medium
102 Find K Closest Elements 658 Array, Two Pointers, Binary Search, Sorting, Heap (Priority Queue) Medium
103 Max Sum of Rectangle No Larger Than K 363 Array, Binary Search, Dynamic Programming, Matrix, Ordered Set Hard
104 Build Array from Permutation 1920 Array, Simulation Easy
105 Eliminate Maximum Number of Monsters 1921 Array, Greedy, Sorting Medium
106 Count Good Numbers 1922 Math, Recursion Medium
107 Count Vowels Permutation 1220 Dynamic Programming Hard
108 Gray Code 89 Math, Backtracking, Bit Manipulation Medium
109 Reshape the Matrix 566 Array, Matrix, Simulation Easy
110 Remove One Element to Make the Array Strictly Increasing 1909 Array Easy
111 Remove All Occurrences of a Substring 1910 String Medium
112 Maximum Alternating Subsequence Sum 1911 Array, Dynamic Programming Medium
113 Reduce Array Size to The Half 1338 Array, Hash Table, Greedy, Sorting, Heap (Priority Queue) Medium
114 The Number of Full Rounds You Have Played 1904 Math, String Medium
115 Kth Smallest Element in a Sorted Matrix 378 Array, Binary Search, Sorting, Heap (Priority Queue), Matrix Medium
116 Maximum Length of Repeated Subarray 718 Array, Binary Search, Dynamic Programming, Sliding Window, Rolling Hash, Hash Function Medium
117 Longest Increasing Subsequence 300 Array, Binary Search, Dynamic Programming Medium
118 Concatenation of Array 1929 Array Easy
119 Painting a Grid With Three Different Colors 1931 Dynamic Programming Hard
120 Merge BSTs to Create Single BST 1932 Hash Table, Binary Search, Tree, Depth-First Search, Binary Tree Hard
121 Unique Length-3 Palindromic Subsequences 1930 Hash Table, String, Prefix Sum Medium
122 Isomorphic Strings 205 Hash Table, String Easy
123 Custom Sort String 791 Hash Table, String, Sorting Medium
124 Find Peak Element 162 Array, Binary Search Medium
125 Valid Triangle Number 611 Array, Two Pointers, Binary Search, Greedy, Sorting Medium
126 Count Square Sum Triples 1925 Math, Enumeration Easy
127 Sum Game 1927 Math, Greedy, Game Theory Medium
128 Nearest Exit from Entrance in Maze 1926 Array, Breadth-First Search, Matrix Medium
129 Three Equal Parts 927 Array, Math Hard
130 Maximum Number of Words You Can Type 1935 Hash Table, String Easy
131 Add Minimum Number of Rungs 1936 Array, Greedy Medium
132 Maximum Number of Points with Cost 1937 Array, Dynamic Programming Medium
133 Push Dominoes 838 Two Pointers, String, Dynamic Programming Medium
134 Partition Array into Disjoint Intervals 915 Array Medium
135 Binary Tree Pruning 814 Tree, Depth-First Search, Binary Tree Medium
136 Sum of Digits of String After Convert 1945 String, Simulation Easy
137 Maximum Compatibility Score Sum 1947 Array, Dynamic Programming, Backtracking, Bit Manipulation, Bitmask Medium
138 Non-negative Integers without Consecutive Ones 600 Dynamic Programming Hard
139 3Sum Closest 16 Array, Two Pointers, Sorting Medium
140 Beautiful Array 932 Array, Math, Divide and Conquer Medium
141 01 Matrix 542 Array, Dynamic Programming, Breadth-First Search, Matrix Medium
142 Map Sum Pairs 677 Hash Table, String, Design, Trie Medium
143 Check if All Characters Have Equal Number of Occurrences 1941 Hash Table, String, Counting Easy
144 The Number of the Smallest Unoccupied Chair 1942 Array, Heap (Priority Queue), Ordered Set Medium
145 Describe the Painting 1943 Array, Prefix Sum Medium
146 Number of Visible People in a Queue 1944 Array, Stack, Monotonic Stack Hard
147 Trapping Rain Water 42 Array, Two Pointers, Dynamic Programming, Stack, Monotonic Stack Hard
148 Three Divisors 1952 Math Easy
149 Minimum Garden Perimeter to Collect Enough Apples 1954 Math, Binary Search Medium
150 Count Number of Special Subsequences 1955 Array, Dynamic Programming Hard
151 Maximum Number of Weeks for Which You Can Work 1953 Array, Greedy Medium
152 Making A Large Island 827 Array, Depth-First Search, Breadth-First Search, Union Find, Matrix Hard
153 Subsets II 90 Array, Backtracking, Bit Manipulation Medium
154 Path Sum II 113 Backtracking, Tree, Depth-First Search, Binary Tree Medium
155 Combinations 77 Array, Backtracking Medium
156 Permutations 46 Array, Backtracking Medium
157 Permutations II 47 Array, Backtracking Medium
158 Stone Game 877 Array, Math, Dynamic Programming, Game Theory Medium
159 Subsets 78 Array, Backtracking, Bit Manipulation Medium
160 Palindrome Partitioning II 132 String, Dynamic Programming Hard
161 Combination Sum 39 Array, Backtracking Medium
162 Combination Sum II 40 Array, Backtracking Medium
163 Remove Stones to Minimize the Total 1962 Array, Heap (Priority Queue) Medium
164 Minimum Number of Swaps to Make the String Balanced 1963 Two Pointers, String, Stack, Greedy Medium
165 Find the Longest Valid Obstacle Course at Each Position 1964 Array, Binary Search, Binary Indexed Tree Hard
166 Check If String Is a Prefix of Array 1961 Array, String Easy
167 Add Strings 415 Math, String, Simulation Easy
168 Largest Number After Mutating Substring 1946 Array, String, Greedy Medium
169 Flip String to Monotone Increasing 926 String, Dynamic Programming Medium
170 Array of Doubled Pairs 954 Array, Hash Table, Greedy, Sorting Medium
171 Group Anagrams 49 Hash Table, String, Sorting Medium
172 Set Matrix Zeroes 73 Array, Hash Table, Matrix Medium
173 Word Ladder II 126 Hash Table, String, Backtracking, Breadth-First Search Hard
174 Remove Boxes 546 Array, Dynamic Programming, Memoization Hard
175 Array With Elements Not Equal to Average of Neighbors 1968 Array, Greedy, Sorting Medium
176 Minimum Non-Zero Product of the Array Elements 1969 Math, Greedy, Recursion Medium
177 Last Day Where You Can Still Cross 1970 Array, Binary Search, Depth-First Search, Breadth-First Search, Union Find, Matrix Hard
178 Range Sum Query - Immutable 303 Array, Design, Prefix Sum Easy
179 Minimum Window Substring 76 Hash Table, String, Sliding Window Hard
180 Count Good Nodes in Binary Tree 1448 Tree, Depth-First Search, Breadth-First Search, Binary Tree Medium
181 Check if Move is Legal 1958 Array, Matrix, Enumeration Medium
182 Minimum Total Space Wasted With K Resizing Operations 1959 Array, Dynamic Programming Medium
183 Delete Characters to Make Fancy String 1957 String Easy
184 Decode Ways 91 String, Dynamic Programming Medium
185 Remove Duplicates from Sorted Array 26 Array, Two Pointers Easy
186 Best Time to Buy and Sell Stock II 122 Array, Dynamic Programming, Greedy Medium
187 Rotate Array 189 Array, Math, Two Pointers Medium
188 Contains Duplicate 217 Array, Hash Table, Sorting Easy
189 Single Number 136 Array, Bit Manipulation Easy
190 Maximum Product of Splitted Binary Tree 1339 Tree, Depth-First Search, Binary Tree Medium
191 Intersection of Two Arrays II 350 Array, Hash Table, Two Pointers, Binary Search, Sorting Easy
192 Intersection of Two Arrays 349 Array, Hash Table, Two Pointers, Binary Search, Sorting Easy
193 Plus One 66 Array, Math Easy
194 Move Zeroes 283 Array, Two Pointers Easy
195 Two Sum 1 Array, Hash Table Easy
196 Rotate Image 48 Array, Math, Matrix Medium
197 Valid Sudoku 36 Array, Hash Table, Matrix Medium
198 Reverse String 344 Two Pointers, String, Recursion Easy
199 Reverse Integer 7 Math Easy
200 First Unique Character in a String 387 Hash Table, String, Queue, Counting Easy
201 Valid Anagram 242 Hash Table, String, Sorting Easy
202 Valid Palindrome 125 Two Pointers, String Easy
203 String to Integer (atoi) 8 String Medium
204 Implement strStr() 28 Two Pointers, String, String Matching Easy
205 Minimum Time to Type Word Using Special Typewriter 1974 String, Greedy Easy
206 Maximum Matrix Sum 1975 Array, Greedy, Matrix Medium
207 Find Greatest Common Divisor of Array 1979 Array, Math Easy
208 Find Unique Binary String 1980 Array, String, Backtracking Medium
209 Minimize the Difference Between Target and Chosen Elements 1981 Array, Dynamic Programming, Matrix Medium
210 Sudoku Solver 37 Array, Backtracking, Matrix Hard
211 Merge Intervals 56 Array, Sorting Medium
212 Rectangle Area II 850 Array, Segment Tree, Line Sweep, Ordered Set Hard
213 Two Sum IV - Input is a BST 653 Hash Table, Two Pointers, Tree, Depth-First Search, Breadth-First Search, Binary Search Tree, Binary Tree Easy
214 Complex Number Multiplication 537 Math, String, Simulation Medium
215 Count and Say 38 String Medium
216 Longest Common Prefix 14 String Easy
217 Sum of Square Numbers 633 Math, Two Pointers, Binary Search Medium
218 Delete Node in a Linked List 237 Linked List Easy
219 Remove Nth Node From End of List 19 Linked List, Two Pointers Medium
220 Verify Preorder Serialization of a Binary Tree 331 String, Stack, Tree, Binary Tree Medium
221 Longest Uncommon Subsequence II 522 Array, Hash Table, Two Pointers, String, Sorting Medium
222 Minimum Difference Between Highest and Lowest of K Scores 1984 Array, Sorting Easy
223 Find the Kth Largest Integer in the Array 1985 Array, String, Divide and Conquer, Sorting, Heap (Priority Queue), Quickselect Medium
224 Maximum Profit in Job Scheduling 1235 Array, Binary Search, Dynamic Programming, Sorting Hard
225 Minimum Number of Work Sessions to Finish the Tasks 1986 Array, Dynamic Programming, Backtracking, Bit Manipulation, Bitmask Medium
226 Range Addition II 598 Array, Math Easy
227 Patching Array 330 Array, Greedy Hard
228 Merge Two Sorted Lists 21 Linked List, Recursion Easy
229 Palindrome Linked List 234 Linked List, Two Pointers, Stack, Recursion Easy
230 Find Minimum in Rotated Sorted Array 153 Array, Binary Search Medium
231 Linked List Cycle 141 Hash Table, Linked List, Two Pointers Easy
232 Maximum Depth of Binary Tree 104 Tree, Depth-First Search, Breadth-First Search, Binary Tree Easy
233 Validate Binary Search Tree 98 Tree, Depth-First Search, Binary Search Tree, Binary Tree Medium
234 Symmetric Tree 101 Tree, Depth-First Search, Breadth-First Search, Binary Tree Easy
235 Number of Strings That Appear as Substrings in Word 1967 String Easy
236 Array Nesting 565 Array, Depth-First Search Medium
237 Binary Tree Level Order Traversal 102 Tree, Breadth-First Search, Binary Tree Medium
238 Convert Sorted Array to Binary Search Tree 108 Array, Divide and Conquer, Tree, Binary Search Tree, Binary Tree Easy
239 Unique Binary Search Trees II 95 Dynamic Programming, Backtracking, Tree, Binary Search Tree, Binary Tree Medium
240 Merge Sorted Array 88 Array, Two Pointers, Sorting Easy
241 Sum of Distances in Tree 834 Dynamic Programming, Tree, Depth-First Search, Graph Hard
242 First Bad Version 278 Binary Search, Interactive Easy
243 Climbing Stairs 70 Math, Dynamic Programming, Memoization Easy
244 Best Time to Buy and Sell Stock 121 Array, Dynamic Programming Easy
245 Maximum Subarray 53 Array, Divide and Conquer, Dynamic Programming Easy
246 House Robber 198 Array, Dynamic Programming Medium
247 Shuffle an Array 384 Array, Math, Randomized Medium
248 Find the Middle Index in Array 1991 Array, Prefix Sum Easy
249 Find All Groups of Farmland 1992 Array, Depth-First Search, Breadth-First Search, Matrix Medium
250 Operations on Tree 1993 Hash Table, Tree, Breadth-First Search, Design Medium
251 Min Stack 155 Stack, Design Easy
252 Orderly Queue 899 Math, String, Sorting Hard
253 Slowest Key 1629 Array, String Easy
254 Reverse Linked List 206 Linked List, Recursion Easy
255 Fizz Buzz 412 Math, String, Simulation Easy
256 Count Primes 204 Array, Math, Enumeration, Number Theory Easy
257 Power of Three 326 Math, Recursion Easy
258 Shifting Letters 848 Array, String Medium
259 Roman to Integer 13 Hash Table, Math, String Easy
260 Number of 1 Bits 191 Bit Manipulation Easy
261 Hamming Distance 461 Bit Manipulation Easy
262 Largest Plus Sign 764 Array, Dynamic Programming Medium
263 Reverse Bits 190 Divide and Conquer, Bit Manipulation Easy
264 Pascal's Triangle 118 Array, Dynamic Programming Easy
265 Valid Parentheses 20 String, Stack Easy
266 Missing Number 268 Array, Hash Table, Math, Bit Manipulation, Sorting Easy
267 Basic Calculator 224 Math, String, Stack, Recursion Hard
268 Arithmetic Slices II - Subsequence 446 Array, Dynamic Programming Hard
269 Number of Pairs of Interchangeable Rectangles 2001 Medium
270 Smallest Missing Genetic Value in Each Subtree 2003 Hard
271 Maximum Product of the Length of Two Palindromic Subsequences 2002 Medium
272 Reverse Prefix of Word 2000 Easy
273 Count Special Quadruplets 1995 Array, Enumeration Easy
274 First Day Where You Have Been in All the Rooms 1997 Array, Dynamic Programming Medium
275 The Number of Weak Characters in the Game 1996 Array, Stack, Greedy, Sorting, Monotonic Stack Medium
276 Maximum Number of Balloons 1189 Hash Table, String, Counting Easy
277 Reverse Only Letters 917 Two Pointers, String Easy
278 Number of Unique Good Subsequences 1987 String, Dynamic Programming Hard
279 Longest Turbulent Subarray 978 Array, Dynamic Programming, Sliding Window Medium
280 Spiral Matrix 54 Array, Matrix, Simulation Medium
281 Expression Add Operators 282 Math, String, Backtracking Hard
282 Count Number of Pairs With Absolute Difference K 2006 Array Easy
283 Find Original Array From Doubled Array 2007 Array, Hash Table, Greedy, Sorting Medium
284 Maximum Earnings From Taxi 2008 Array, Binary Search, Dynamic Programming, Sorting Medium
285 Minimum Number of Operations to Make Array Continuous 2009 Array, Binary Search Hard
286 Final Value of Variable After Performing Operations 2011 Array, String, Simulation Easy
287 Sum of Beauty in the Array 2012 Array Medium
288 Detect Squares 2013 Array, Hash Table, Design, Counting Medium
289 Distinct Subsequences 115 String, Dynamic Programming Hard
290 Find Winner on a Tic Tac Toe Game 1275 Array, Hash Table, Matrix, Simulation Easy
291 Max Consecutive Ones 485 Array Easy
292 3Sum 15 Array, Two Pointers, Sorting Medium
293 Longest Substring Without Repeating Characters 3 Hash Table, String, Sliding Window Medium
294 Longest Palindromic Substring 5 String, Dynamic Programming Medium
295 Increasing Triplet Subsequence 334 Array, Greedy Medium
296 Add Two Numbers 2 Linked List, Math, Recursion Medium
297 Odd Even Linked List 328 Linked List Medium
298 Intersection of Two Linked Lists 160 Hash Table, Linked List, Two Pointers Easy
299 Maximum Length of a Concatenated String with Unique Characters 1239 Array, String, Backtracking, Bit Manipulation Medium
300 GCD Sort of an Array 1998 Array, Math, Union Find, Sorting Hard
301 Binary Tree Zigzag Level Order Traversal 103 Tree, Breadth-First Search, Binary Tree Medium
302 Construct Binary Tree from Preorder and Inorder Traversal 105 Array, Hash Table, Divide and Conquer, Tree, Binary Tree Medium
303 Kth Smallest Element in a BST 230 Tree, Depth-First Search, Binary Search Tree, Binary Tree Medium
304 Binary Tree Inorder Traversal 94 Stack, Tree, Depth-First Search, Binary Tree Easy
305 Number of Islands 200 Array, Depth-First Search, Breadth-First Search, Union Find, Matrix Medium
306 Letter Combinations of a Phone Number 17 Hash Table, String, Backtracking Medium
307 Generate Parentheses 22 String, Dynamic Programming, Backtracking Medium
308 Word Search 79 Array, Backtracking, Matrix Medium
309 Break a Palindrome 1328 String, Greedy Medium
310 N-th Tribonacci Number 1137 Math, Dynamic Programming, Memoization Easy
311 Sort Colors 75 Array, Two Pointers, Sorting Medium
312 Top K Frequent Elements 347 Array, Hash Table, Divide and Conquer, Sorting, Heap (Priority Queue), Bucket Sort, Counting, Quickselect Medium
313 Shortest Path in a Grid with Obstacles Elimination 1293 Array, Breadth-First Search, Matrix Hard
314 Maximum Difference Between Increasing Elements 2016 Array Easy
315 Grid Game 2017 Array, Matrix, Prefix Sum Medium
316 Check if Word Can Be Placed In Crossword 2018 Array, Matrix, Enumeration Medium
317 Unique Email Addresses 929 Array, Hash Table, String Easy
318 Sort Array By Parity II 922 Array, Two Pointers, Sorting Easy
319 Partition to K Equal Sum Subsets 698 Array, Dynamic Programming, Backtracking, Bit Manipulation, Memoization, Bitmask Medium
320 Split Linked List in Parts 725 Linked List Medium
321 Longest Common Subsequence 1143 String, Dynamic Programming Medium
322 Jump Game 55 Array, Dynamic Programming, Greedy Medium
323 Dungeon Game 174 Array, Dynamic Programming, Matrix Hard
324 Minimum Moves to Convert String 2027 Easy
325 Find Missing Observations 2028 Medium
326 Stone Game IX 2029 Medium
327 Subtree of Another Tree 572 Tree, Depth-First Search, String Matching, Binary Tree, Hash Function Easy
328 Island Perimeter 463 Array, Depth-First Search, Breadth-First Search, Matrix Easy
329 Longest Subsequence Repeated k Times 2014 String, Backtracking, Greedy, Counting, Enumeration Hard
330 Find All Duplicates in an Array 442 Array, Hash Table Medium
331 Kth Largest Element in an Array 215 Array, Divide and Conquer, Sorting, Heap (Priority Queue), Quickselect Medium
332 Implement Trie (Prefix Tree) 208 Hash Table, String, Design, Trie Medium
333 Find First and Last Position of Element in Sorted Array 34 Array, Binary Search Medium
334 Search in Rotated Sorted Array 33 Array, Binary Search Medium
335 Convert 1D Array Into 2D Array 2022 Array, Matrix, Simulation Easy
336 Number of Pairs of Strings With Concatenation Equal to Target 2023 Array, String Medium
337 Maximize the Confusion of an Exam 2024 String, Binary Search, Sliding Window, Prefix Sum Medium
338 Max Consecutive Ones III 1004 Array, Binary Search, Sliding Window, Prefix Sum Medium
339 Longest Repeating Character Replacement 424 Hash Table, String, Sliding Window Medium
340 Maximum Number of Ways to Partition an Array 2025 Array, Hash Table, Counting, Enumeration, Prefix Sum Hard
341 Word Search II 212 Array, String, Backtracking, Trie, Matrix Hard
342 Two Out of Three 2032 Array, Hash Table Easy
343 Minimum Operations to Make a Uni-Value Grid 2033 Array, Math, Sorting, Matrix Medium
344 Stock Price Fluctuation 2034 Hash Table, Design, Heap (Priority Queue), Ordered Set Medium
345 Partition Array Into Two Arrays to Minimize Sum Difference 2035 Array, Two Pointers, Binary Search, Dynamic Programming, Bit Manipulation, Ordered Set, Bitmask Hard
346 Diameter of Binary Tree 543 Tree, Depth-First Search, Binary Tree Easy
347 Bitwise AND of Numbers Range 201 Bit Manipulation Medium
348 Search a 2D Matrix II 240 Array, Binary Search, Divide and Conquer, Matrix Medium
349 Guess Number Higher or Lower 374 Binary Search, Interactive Easy
350 Unique Paths 62 Math, Dynamic Programming, Combinatorics Medium
351 Coin Change 322 Array, Dynamic Programming, Breadth-First Search Medium
352 Construct Binary Search Tree from Preorder Traversal 1008 Array, Stack, Tree, Binary Search Tree, Monotonic Stack, Binary Tree Medium
353 Perfect Squares 279 Math, Dynamic Programming, Breadth-First Search Medium
354 Best Time to Buy and Sell Stock with Cooldown 309 Array, Dynamic Programming Medium
355 Minimum Number of Moves to Seat Everyone 2037 Array, Sorting Easy
356 Remove Colored Pieces if Both Neighbors are the Same Color 2038 Math, String, Greedy, Game Theory Medium
357 The Time When the Network Becomes Idle 2039 Array, Breadth-First Search, Graph Medium
358 Check if Numbers Are Ascending in a Sentence 2042 String Easy
359 Simple Bank System 2043 Array, Hash Table, Design, Simulation Medium
360 Count Number of Maximum Bitwise-OR Subsets 2044 Array, Backtracking, Bit Manipulation Medium
361 Second Minimum Time to Reach Destination 2045 Array, Breadth-First Search, Graph, Shortest Path Hard
362 Path Sum III 437 Tree, Depth-First Search, Binary Tree Medium
363 Cousins in Binary Tree 993 Tree, Depth-First Search, Breadth-First Search, Binary Tree Easy
364 Best Time to Buy and Sell Stock III 123 Array, Dynamic Programming Hard
365 Happy Number 202 Hash Table, Math, Two Pointers Easy
366 Factorial Trailing Zeroes 172 Math Medium
367 Excel Sheet Column Number 171 Math, String Easy
368 Pow(x, n) 50 Math, Recursion Medium
369 Sqrt(x) 69 Math, Binary Search Easy
370 Next Greater Element I 496 Array, Hash Table, Stack, Monotonic Stack Easy
371 Sum of Two Integers 371 Math, Bit Manipulation Medium
372 Reverse Words in a String 151 Two Pointers, String Medium
373 Insert Delete GetRandom O(1) 380 Array, Hash Table, Math, Design, Randomized Medium
374 Evaluate Reverse Polish Notation 150 Array, Math, Stack Medium
375 Majority Element 169 Array, Hash Table, Divide and Conquer, Sorting, Counting Easy
376 Sort Characters By Frequency 451 Hash Table, String, Sorting, Heap (Priority Queue), Bucket Sort, Counting Medium
377 Task Scheduler 621 Array, Hash Table, Greedy, Sorting, Heap (Priority Queue), Counting Medium
378 Find Minimum in Rotated Sorted Array II 154 Array, Binary Search Hard
379 Number of Valid Words in a Sentence 2047 Easy
380 Next Greater Numerically Balanced Number 2048 Medium
381 Count Nodes With the Highest Score 2049 Medium
382 Parallel Courses III 2050 Hard
383 Count Complete Tree Nodes 222 Binary Search, Tree, Depth-First Search, Binary Tree Medium
384 Invert Binary Tree 226 Tree, Depth-First Search, Breadth-First Search, Binary Tree Easy
385 Network Delay Time 743 Depth-First Search, Breadth-First Search, Graph, Heap (Priority Queue), Shortest Path Medium
386 Path with Maximum Probability 1514 Graph, Heap (Priority Queue), Shortest Path Medium
387 Path With Minimum Effort 1631 Array, Binary Search, Depth-First Search, Breadth-First Search, Union Find, Heap (Priority Queue), Matrix Medium
388 Rotting Oranges 994 Array, Breadth-First Search, Matrix Medium
389 Smallest Index With Equal Value 2057 Array Easy
390 Find the Minimum and Maximum Number of Nodes Between Critical Points 2058 Linked List Medium
391 Minimum Operations to Convert Number 2059 Array, Breadth-First Search Medium
392 Surrounded Regions 130 Array, Depth-First Search, Breadth-First Search, Union Find, Matrix Medium
393 Sum Root to Leaf Numbers 129 Tree, Depth-First Search, Binary Tree Medium
394 Sum of Left Leaves 404 Tree, Depth-First Search, Breadth-First Search, Binary Tree Easy
395 Arranging Coins 441 Math, Binary Search Easy
396 Kth Distinct String in an Array 2053 Array, Hash Table, String, Counting Easy
397 Two Best Non-Overlapping Events 2054 Array, Binary Search, Dynamic Programming, Sorting, Heap (Priority Queue) Medium
398 Plates Between Candles 2055 Array, String, Binary Search, Prefix Sum Medium
399 Single Number III 260 Array, Bit Manipulation Medium
400 Vowels of All Substrings 2063 Math, String, Dynamic Programming, Combinatorics Medium
401 Minimized Maximum of Products Distributed to Any Store 2064 Array, Binary Search Medium
402 Multiply Strings 43 Math, String, Simulation Medium
403 Maximum Path Quality of a Graph 2065 Array, Backtracking, Graph Hard
404 Unique Binary Search Trees 96 Math, Dynamic Programming, Tree, Binary Search Tree, Binary Tree Medium
405 Number of Valid Words for Each Puzzle 1178 Array, Hash Table, String, Bit Manipulation, Trie Hard
406 Minimum Value to Get Positive Step by Step Sum 1413 Array, Prefix Sum Easy
407 First Missing Positive 41 Array, Hash Table Hard
408 Remove Linked List Elements 203 Linked List, Recursion Easy
409 Daily Temperatures 739 Array, Stack, Monotonic Stack Medium
410 Guess the Word 843 Array, Math, String, Interactive, Game Theory Hard
411 Check Whether Two Strings are Almost Equivalent 2068 Hash Table, String, Counting Easy
412 Most Beautiful Item for Each Query 2070 Array, Binary Search, Sorting Medium
413 Walking Robot Simulation II 2069 Design, Simulation Medium
414 Time Needed to Buy Tickets 2073 Array, Queue, Simulation Easy
415 Reverse Nodes in Even Length Groups 2074 Linked List Medium
416 Decode the Slanted Ciphertext 2075 String, Simulation Medium
417 Process Restricted Friend Requests 2076 Union Find, Graph Hard
418 Iterator for Combination 1286 String, Backtracking, Design, Iterator Medium
419 Expressive Words 809 Array, Two Pointers, String Medium
420 Validate Stack Sequences 946 Array, Stack, Simulation Medium
421 Largest Divisible Subset 368 Array, Math, Dynamic Programming, Sorting Medium
422 Redundant Connection 684 Depth-First Search, Breadth-First Search, Union Find, Graph Medium
423 Kth Smallest Number in Multiplication Table 668 Binary Search Hard
424 Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit 1438 Array, Queue, Sliding Window, Heap (Priority Queue), Ordered Set, Monotonic Queue Medium
425 Find All Numbers Disappeared in an Array 448 Array, Hash Table Easy
426 Delete Nodes And Return Forest 1110 Tree, Depth-First Search, Binary Tree Medium
427 Text Justification 68 Array, String, Simulation Hard
428 Single Element in a Sorted Array 540 Array, Binary Search Medium
429 Logger Rate Limiter 359 Hash Table, Design Easy
430 Find Leaves of Binary Tree 366 Tree, Depth-First Search, Binary Tree Medium
431 Construct Binary Tree from Inorder and Postorder Traversal 106 Array, Hash Table, Divide and Conquer, Tree, Binary Tree Medium
432 Two Furthest Houses With Different Colors 2078 Easy
433 Watering Plants 2079 Array Medium
434 Sum of k-Mirror Numbers 2081 Hard
435 Range Frequency Queries 2080 Array, Binary Search Medium
436 Longest Absolute File Path 388 String, Stack, Depth-First Search Medium
437 Decode String 394 String, Stack, Recursion Medium
438 Delete Node in a BST 450 Tree, Binary Search Tree, Binary Tree Medium
439 Count Vowel Substrings of a String 2062 Hash Table, String Easy

Difficulty

Easy Questions

ID Problem Leetcode ID Categories
1 429
2 116
3 297
4 430
5 284
6 Get Maximum in Generated Array 1646 Array, Dynamic Programming, Simulation
7 Design an Ordered Stream 1656 Array, Hash Table, Design, Data Stream
8 Check If Two String Arrays are Equivalent 1662 Array, String
9 Richest Customer Wealth 1672 Array, Matrix
10 Count of Matches in Tournament 1688 Math, Simulation
11 Determine if String Halves Are Alike 1704 String, Counting
12 Maximum Units on a Truck 1710 Array, Greedy, Sorting
13 Decode XORed Array 1720 Array, Bit Manipulation
14 Number Of Rectangles That Can Form The Largest Square 1725 Array
15 Latest Time by Replacing Hidden Digits 1736 String, Greedy
16 Maximum Number of Balls in a Box 1742 Hash Table, Math, Counting
17 Check if Array Is Sorted and Rotated 1752 Array
18 Minimum Changes To Make Alternating Binary String 1758 String
19 Merge Strings Alternately 1768 Two Pointers, String
20 Check if Binary String Has at Most One Segment of Ones 1784 String
21 Check if One String Swap Can Make Strings Equal 1790 Hash Table, String, Counting
22 Find Center of Star Graph 1791 Graph
23 Maximum Ascending Subarray Sum 1800 Array
24 Number of Different Integers in a String 1805 Hash Table, String
25 Truncate Sentence 1816 Array, String
26 Sign of the Product of an Array 1822 Array, Math
27 Check if the Sentence Is Pangram 1832 Hash Table, String
28 Sum of Digits in Base K 1837 Math
29 Minimum Distance to the Target Element 1848 Array
30 Longer Contiguous Segments of Ones than Zeros 1869 String
31 Maximum Population Year 1854 Array, Counting
32 Sum of All Subset XOR Totals 1863 Array, Backtracking, Bit Manipulation
33 Determine Whether Matrix Can Be Obtained By Rotation 1886 Array, Matrix
34 Redistribute Characters to Make All Strings Equal 1897 Hash Table, String, Counting
35 Check if Word Equals Summation of Two Words 1880 String
36 Largest Odd Number in String 1903 Math, String, Greedy
37 Maximum Product Difference Between Two Pairs 1913 Array, Sorting
38 Build Array from Permutation 1920 Array, Simulation
39 Reshape the Matrix 566 Array, Matrix, Simulation
40 Remove One Element to Make the Array Strictly Increasing 1909 Array
41 Concatenation of Array 1929 Array
42 Isomorphic Strings 205 Hash Table, String
43 Count Square Sum Triples 1925 Math, Enumeration
44 Maximum Number of Words You Can Type 1935 Hash Table, String
45 Sum of Digits of String After Convert 1945 String, Simulation
46 Check if All Characters Have Equal Number of Occurrences 1941 Hash Table, String, Counting
47 Three Divisors 1952 Math
48 Check If String Is a Prefix of Array 1961 Array, String
49 Add Strings 415 Math, String, Simulation
50 Range Sum Query - Immutable 303 Array, Design, Prefix Sum
51 Delete Characters to Make Fancy String 1957 String
52 Remove Duplicates from Sorted Array 26 Array, Two Pointers
53 Contains Duplicate 217 Array, Hash Table, Sorting
54 Single Number 136 Array, Bit Manipulation
55 Intersection of Two Arrays II 350 Array, Hash Table, Two Pointers, Binary Search, Sorting
56 Intersection of Two Arrays 349 Array, Hash Table, Two Pointers, Binary Search, Sorting
57 Plus One 66 Array, Math
58 Move Zeroes 283 Array, Two Pointers
59 Two Sum 1 Array, Hash Table
60 Reverse String 344 Two Pointers, String, Recursion
61 Reverse Integer 7 Math
62 First Unique Character in a String 387 Hash Table, String, Queue, Counting
63 Valid Anagram 242 Hash Table, String, Sorting
64 Valid Palindrome 125 Two Pointers, String
65 Implement strStr() 28 Two Pointers, String, String Matching
66 Minimum Time to Type Word Using Special Typewriter 1974 String, Greedy
67 Find Greatest Common Divisor of Array 1979 Array, Math
68 Two Sum IV - Input is a BST 653 Hash Table, Two Pointers, Tree, Depth-First Search, Breadth-First Search, Binary Search Tree, Binary Tree
69 Longest Common Prefix 14 String
70 Delete Node in a Linked List 237 Linked List
71 Minimum Difference Between Highest and Lowest of K Scores 1984 Array, Sorting
72 Range Addition II 598 Array, Math
73 Merge Two Sorted Lists 21 Linked List, Recursion
74 Palindrome Linked List 234 Linked List, Two Pointers, Stack, Recursion
75 Linked List Cycle 141 Hash Table, Linked List, Two Pointers
76 Maximum Depth of Binary Tree 104 Tree, Depth-First Search, Breadth-First Search, Binary Tree
77 Symmetric Tree 101 Tree, Depth-First Search, Breadth-First Search, Binary Tree
78 Number of Strings That Appear as Substrings in Word 1967 String
79 Convert Sorted Array to Binary Search Tree 108 Array, Divide and Conquer, Tree, Binary Search Tree, Binary Tree
80 Merge Sorted Array 88 Array, Two Pointers, Sorting
81 First Bad Version 278 Binary Search, Interactive
82 Climbing Stairs 70 Math, Dynamic Programming, Memoization
83 Best Time to Buy and Sell Stock 121 Array, Dynamic Programming
84 Maximum Subarray 53 Array, Divide and Conquer, Dynamic Programming
85 Find the Middle Index in Array 1991 Array, Prefix Sum
86 Min Stack 155 Stack, Design
87 Slowest Key 1629 Array, String
88 Reverse Linked List 206 Linked List, Recursion
89 Fizz Buzz 412 Math, String, Simulation
90 Count Primes 204 Array, Math, Enumeration, Number Theory
91 Power of Three 326 Math, Recursion
92 Roman to Integer 13 Hash Table, Math, String
93 Number of 1 Bits 191 Bit Manipulation
94 Hamming Distance 461 Bit Manipulation
95 Reverse Bits 190 Divide and Conquer, Bit Manipulation
96 Pascal's Triangle 118 Array, Dynamic Programming
97 Valid Parentheses 20 String, Stack
98 Missing Number 268 Array, Hash Table, Math, Bit Manipulation, Sorting
99 Reverse Prefix of Word 2000
100 Count Special Quadruplets 1995 Array, Enumeration
101 Maximum Number of Balloons 1189 Hash Table, String, Counting
102 Reverse Only Letters 917 Two Pointers, String
103 Count Number of Pairs With Absolute Difference K 2006 Array
104 Final Value of Variable After Performing Operations 2011 Array, String, Simulation
105 Find Winner on a Tic Tac Toe Game 1275 Array, Hash Table, Matrix, Simulation
106 Max Consecutive Ones 485 Array
107 Intersection of Two Linked Lists 160 Hash Table, Linked List, Two Pointers
108 Binary Tree Inorder Traversal 94 Stack, Tree, Depth-First Search, Binary Tree
109 N-th Tribonacci Number 1137 Math, Dynamic Programming, Memoization
110 Maximum Difference Between Increasing Elements 2016 Array
111 Unique Email Addresses 929 Array, Hash Table, String
112 Sort Array By Parity II 922 Array, Two Pointers, Sorting
113 Minimum Moves to Convert String 2027
114 Subtree of Another Tree 572 Tree, Depth-First Search, String Matching, Binary Tree, Hash Function
115 Island Perimeter 463 Array, Depth-First Search, Breadth-First Search, Matrix
116 Convert 1D Array Into 2D Array 2022 Array, Matrix, Simulation
117 Two Out of Three 2032 Array, Hash Table
118 Diameter of Binary Tree 543 Tree, Depth-First Search, Binary Tree
119 Guess Number Higher or Lower 374 Binary Search, Interactive
120 Minimum Number of Moves to Seat Everyone 2037 Array, Sorting
121 Check if Numbers Are Ascending in a Sentence 2042 String
122 Cousins in Binary Tree 993 Tree, Depth-First Search, Breadth-First Search, Binary Tree
123 Happy Number 202 Hash Table, Math, Two Pointers
124 Excel Sheet Column Number 171 Math, String
125 Sqrt(x) 69 Math, Binary Search
126 Next Greater Element I 496 Array, Hash Table, Stack, Monotonic Stack
127 Majority Element 169 Array, Hash Table, Divide and Conquer, Sorting, Counting
128 Number of Valid Words in a Sentence 2047
129 Invert Binary Tree 226 Tree, Depth-First Search, Breadth-First Search, Binary Tree
130 Smallest Index With Equal Value 2057 Array
131 Sum of Left Leaves 404 Tree, Depth-First Search, Breadth-First Search, Binary Tree
132 Arranging Coins 441 Math, Binary Search
133 Kth Distinct String in an Array 2053 Array, Hash Table, String, Counting
134 Minimum Value to Get Positive Step by Step Sum 1413 Array, Prefix Sum
135 Remove Linked List Elements 203 Linked List, Recursion
136 Check Whether Two Strings are Almost Equivalent 2068 Hash Table, String, Counting
137 Time Needed to Buy Tickets 2073 Array, Queue, Simulation
138 Find All Numbers Disappeared in an Array 448 Array, Hash Table
139 Logger Rate Limiter 359 Hash Table, Design
140 Two Furthest Houses With Different Colors 2078
141 Count Vowel Substrings of a String 2062 Hash Table, String

Medium Questions

ID Problem Leetcode ID Categories
1 Minimum Deletions to Make Character Frequencies Unique 1647 String, Greedy, Sorting
2 Sell Diminishing-Valued Colored Balls 1648 Array, Math, Binary Search, Greedy, Sorting, Heap (Priority Queue)
3 Determine if Two Strings Are Close 1657 Hash Table, String, Sorting
4 Smallest String With A Given Numeric Value 1663 String, Greedy
5 Find the Most Competitive Subsequence 1673 Array, Stack, Greedy, Monotonic Stack
6 Minimum Moves to Make Array Complementary 1674 Array, Hash Table, Prefix Sum
7 Partitioning Into Minimum Number Of Deci-Binary Numbers 1689 String, Greedy
8 Maximum Number of Eaten Apples 1705 Array, Greedy, Heap (Priority Queue)
9 Where Will the Ball Fall 1706 Array, Dynamic Programming, Depth-First Search, Matrix, Simulation
10 Count Good Meals 1711 Array, Hash Table
11 Swapping Nodes in a Linked List 1721 Linked List, Two Pointers
12 Minimize Hamming Distance After Swap Operations 1722 Array, Depth-First Search, Union Find
13 Tuple with Same Product 1726 Array, Hash Table
14 Largest Submatrix With Rearrangements 1727 Array, Greedy, Sorting, Matrix
15 Change Minimum Characters to Satisfy One of Three Conditions 1737 Hash Table, String, Counting, Prefix Sum
16 Find Kth Largest XOR Coordinate Value 1738 Array, Divide and Conquer, Bit Manipulation, Heap (Priority Queue), Matrix, Prefix Sum, Quickselect
17 Restore the Array From Adjacent Pairs 1743 Array, Hash Table
18 Count Number of Homogenous Substrings 1759 Math, String
19 Minimum Number of Operations to Move All Balls to Each Box 1769 Array, String
20 Maximum Score from Performing Multiplication Operations 1770 Array, Dynamic Programming
21 Maximum Average Pass Ratio 1792 Array, Greedy, Heap (Priority Queue)
22 Number of Orders in the Backlog 1801 Array, Heap (Priority Queue), Simulation
23 Finding the Users Active Minutes 1817 Array, Hash Table
24 Minimum Absolute Sum Difference 1818 Array, Binary Search, Sorting, Ordered Set
25 Find the Winner of the Circular Game 1823 Array, Math, Recursion, Queue, Simulation
26 Minimum Sideway Jumps 1824 Array, Dynamic Programming, Greedy
27 Maximum Ice Cream Bars 1833 Array, Greedy, Sorting
28 Single-Threaded CPU 1834 Array, Sorting, Heap (Priority Queue)
29 Frequency of the Most Frequent Element 1838 Array, Binary Search, Greedy, Sliding Window, Sorting, Prefix Sum
30 Longest Substring Of All Vowels in Order 1839 String, Sliding Window
31 Minimum Number of Swaps to Make the Binary String Alternating 1864 String, Greedy
32 Finding Pairs With a Certain Sum 1865 Array, Hash Table, Design
33 Splitting a String Into Descending Consecutive Values 1849 String, Backtracking
34 Next Permutation 31 Array, Two Pointers
35 Minimum Adjacent Swaps to Reach the Kth Smallest Number 1850 Two Pointers, String, Greedy
36 Maximum Distance Between a Pair of Values 1855 Array, Two Pointers, Binary Search, Greedy
37 Maximum Subarray Min-Product 1856 Array, Stack, Monotonic Stack, Prefix Sum
38 Minimum Speed to Arrive on Time 1870 Array, Binary Search
39 Jump Game VII 1871 Two Pointers, String, Prefix Sum
40 Process Tasks Using Servers 1882 Array, Heap (Priority Queue)
41 Merge Triplets to Form Target Triplet 1899 Array, Greedy
42 Maximum Value after Insertion 1881 String, Greedy
43 Count Sub Islands 1905 Array, Depth-First Search, Breadth-First Search, Union Find, Matrix
44 Minimum Absolute Difference Queries 1906 Array, Hash Table
45 Reduction Operations to Make the Array Elements Equal 1887 Array, Sorting
46 Minimum Number of Flips to Make the Binary String Alternating 1888 String, Greedy
47 Cyclically Rotating a Grid 1914 Array, Matrix, Simulation
48 Number of Wonderful Substrings 1915 Hash Table, String, Bit Manipulation, Prefix Sum
49 Maximum Number of Removable Characters 1898 Array, String, Binary Search
50 Find K Closest Elements 658 Array, Two Pointers, Binary Search, Sorting, Heap (Priority Queue)
51 Eliminate Maximum Number of Monsters 1921 Array, Greedy, Sorting
52 Count Good Numbers 1922 Math, Recursion
53 Gray Code 89 Math, Backtracking, Bit Manipulation
54 Remove All Occurrences of a Substring 1910 String
55 Maximum Alternating Subsequence Sum 1911 Array, Dynamic Programming
56 Reduce Array Size to The Half 1338 Array, Hash Table, Greedy, Sorting, Heap (Priority Queue)
57 The Number of Full Rounds You Have Played 1904 Math, String
58 Kth Smallest Element in a Sorted Matrix 378 Array, Binary Search, Sorting, Heap (Priority Queue), Matrix
59 Maximum Length of Repeated Subarray 718 Array, Binary Search, Dynamic Programming, Sliding Window, Rolling Hash, Hash Function
60 Longest Increasing Subsequence 300 Array, Binary Search, Dynamic Programming
61 Unique Length-3 Palindromic Subsequences 1930 Hash Table, String, Prefix Sum
62 Custom Sort String 791 Hash Table, String, Sorting
63 Find Peak Element 162 Array, Binary Search
64 Valid Triangle Number 611 Array, Two Pointers, Binary Search, Greedy, Sorting
65 Sum Game 1927 Math, Greedy, Game Theory
66 Nearest Exit from Entrance in Maze 1926 Array, Breadth-First Search, Matrix
67 Add Minimum Number of Rungs 1936 Array, Greedy
68 Maximum Number of Points with Cost 1937 Array, Dynamic Programming
69 Push Dominoes 838 Two Pointers, String, Dynamic Programming
70 Partition Array into Disjoint Intervals 915 Array
71 Binary Tree Pruning 814 Tree, Depth-First Search, Binary Tree
72 Maximum Compatibility Score Sum 1947 Array, Dynamic Programming, Backtracking, Bit Manipulation, Bitmask
73 3Sum Closest 16 Array, Two Pointers, Sorting
74 Beautiful Array 932 Array, Math, Divide and Conquer
75 01 Matrix 542 Array, Dynamic Programming, Breadth-First Search, Matrix
76 Map Sum Pairs 677 Hash Table, String, Design, Trie
77 The Number of the Smallest Unoccupied Chair 1942 Array, Heap (Priority Queue), Ordered Set
78 Describe the Painting 1943 Array, Prefix Sum
79 Minimum Garden Perimeter to Collect Enough Apples 1954 Math, Binary Search
80 Maximum Number of Weeks for Which You Can Work 1953 Array, Greedy
81 Subsets II 90 Array, Backtracking, Bit Manipulation
82 Path Sum II 113 Backtracking, Tree, Depth-First Search, Binary Tree
83 Combinations 77 Array, Backtracking
84 Permutations 46 Array, Backtracking
85 Permutations II 47 Array, Backtracking
86 Stone Game 877 Array, Math, Dynamic Programming, Game Theory
87 Subsets 78 Array, Backtracking, Bit Manipulation
88 Combination Sum 39 Array, Backtracking
89 Combination Sum II 40 Array, Backtracking
90 Remove Stones to Minimize the Total 1962 Array, Heap (Priority Queue)
91 Minimum Number of Swaps to Make the String Balanced 1963 Two Pointers, String, Stack, Greedy
92 Largest Number After Mutating Substring 1946 Array, String, Greedy
93 Flip String to Monotone Increasing 926 String, Dynamic Programming
94 Array of Doubled Pairs 954 Array, Hash Table, Greedy, Sorting
95 Group Anagrams 49 Hash Table, String, Sorting
96 Set Matrix Zeroes 73 Array, Hash Table, Matrix
97 Array With Elements Not Equal to Average of Neighbors 1968 Array, Greedy, Sorting
98 Minimum Non-Zero Product of the Array Elements 1969 Math, Greedy, Recursion
99 Count Good Nodes in Binary Tree 1448 Tree, Depth-First Search, Breadth-First Search, Binary Tree
100 Check if Move is Legal 1958 Array, Matrix, Enumeration
101 Minimum Total Space Wasted With K Resizing Operations 1959 Array, Dynamic Programming
102 Decode Ways 91 String, Dynamic Programming
103 Best Time to Buy and Sell Stock II 122 Array, Dynamic Programming, Greedy
104 Rotate Array 189 Array, Math, Two Pointers
105 Maximum Product of Splitted Binary Tree 1339 Tree, Depth-First Search, Binary Tree
106 Rotate Image 48 Array, Math, Matrix
107 Valid Sudoku 36 Array, Hash Table, Matrix
108 String to Integer (atoi) 8 String
109 Maximum Matrix Sum 1975 Array, Greedy, Matrix
110 Find Unique Binary String 1980 Array, String, Backtracking
111 Minimize the Difference Between Target and Chosen Elements 1981 Array, Dynamic Programming, Matrix
112 Merge Intervals 56 Array, Sorting
113 Complex Number Multiplication 537 Math, String, Simulation
114 Count and Say 38 String
115 Sum of Square Numbers 633 Math, Two Pointers, Binary Search
116 Remove Nth Node From End of List 19 Linked List, Two Pointers
117 Verify Preorder Serialization of a Binary Tree 331 String, Stack, Tree, Binary Tree
118 Longest Uncommon Subsequence II 522 Array, Hash Table, Two Pointers, String, Sorting
119 Find the Kth Largest Integer in the Array 1985 Array, String, Divide and Conquer, Sorting, Heap (Priority Queue), Quickselect
120 Minimum Number of Work Sessions to Finish the Tasks 1986 Array, Dynamic Programming, Backtracking, Bit Manipulation, Bitmask
121 Find Minimum in Rotated Sorted Array 153 Array, Binary Search
122 Validate Binary Search Tree 98 Tree, Depth-First Search, Binary Search Tree, Binary Tree
123 Array Nesting 565 Array, Depth-First Search
124 Binary Tree Level Order Traversal 102 Tree, Breadth-First Search, Binary Tree
125 Unique Binary Search Trees II 95 Dynamic Programming, Backtracking, Tree, Binary Search Tree, Binary Tree
126 House Robber 198 Array, Dynamic Programming
127 Shuffle an Array 384 Array, Math, Randomized
128 Find All Groups of Farmland 1992 Array, Depth-First Search, Breadth-First Search, Matrix
129 Operations on Tree 1993 Hash Table, Tree, Breadth-First Search, Design
130 Shifting Letters 848 Array, String
131 Largest Plus Sign 764 Array, Dynamic Programming
132 Number of Pairs of Interchangeable Rectangles 2001
133 Maximum Product of the Length of Two Palindromic Subsequences 2002
134 First Day Where You Have Been in All the Rooms 1997 Array, Dynamic Programming
135 The Number of Weak Characters in the Game 1996 Array, Stack, Greedy, Sorting, Monotonic Stack
136 Longest Turbulent Subarray 978 Array, Dynamic Programming, Sliding Window
137 Spiral Matrix 54 Array, Matrix, Simulation
138 Find Original Array From Doubled Array 2007 Array, Hash Table, Greedy, Sorting
139 Maximum Earnings From Taxi 2008 Array, Binary Search, Dynamic Programming, Sorting
140 Sum of Beauty in the Array 2012 Array
141 Detect Squares 2013 Array, Hash Table, Design, Counting
142 3Sum 15 Array, Two Pointers, Sorting
143 Longest Substring Without Repeating Characters 3 Hash Table, String, Sliding Window
144 Longest Palindromic Substring 5 String, Dynamic Programming
145 Increasing Triplet Subsequence 334 Array, Greedy
146 Add Two Numbers 2 Linked List, Math, Recursion
147 Odd Even Linked List 328 Linked List
148 Maximum Length of a Concatenated String with Unique Characters 1239 Array, String, Backtracking, Bit Manipulation
149 Binary Tree Zigzag Level Order Traversal 103 Tree, Breadth-First Search, Binary Tree
150 Construct Binary Tree from Preorder and Inorder Traversal 105 Array, Hash Table, Divide and Conquer, Tree, Binary Tree
151 Kth Smallest Element in a BST 230 Tree, Depth-First Search, Binary Search Tree, Binary Tree
152 Number of Islands 200 Array, Depth-First Search, Breadth-First Search, Union Find, Matrix
153 Letter Combinations of a Phone Number 17 Hash Table, String, Backtracking
154 Generate Parentheses 22 String, Dynamic Programming, Backtracking
155 Word Search 79 Array, Backtracking, Matrix
156 Break a Palindrome 1328 String, Greedy
157 Sort Colors 75 Array, Two Pointers, Sorting
158 Top K Frequent Elements 347 Array, Hash Table, Divide and Conquer, Sorting, Heap (Priority Queue), Bucket Sort, Counting, Quickselect
159 Grid Game 2017 Array, Matrix, Prefix Sum
160 Check if Word Can Be Placed In Crossword 2018 Array, Matrix, Enumeration
161 Partition to K Equal Sum Subsets 698 Array, Dynamic Programming, Backtracking, Bit Manipulation, Memoization, Bitmask
162 Split Linked List in Parts 725 Linked List
163 Longest Common Subsequence 1143 String, Dynamic Programming
164 Jump Game 55 Array, Dynamic Programming, Greedy
165 Find Missing Observations 2028
166 Stone Game IX 2029
167 Find All Duplicates in an Array 442 Array, Hash Table
168 Kth Largest Element in an Array 215 Array, Divide and Conquer, Sorting, Heap (Priority Queue), Quickselect
169 Implement Trie (Prefix Tree) 208 Hash Table, String, Design, Trie
170 Find First and Last Position of Element in Sorted Array 34 Array, Binary Search
171 Search in Rotated Sorted Array 33 Array, Binary Search
172 Number of Pairs of Strings With Concatenation Equal to Target 2023 Array, String
173 Maximize the Confusion of an Exam 2024 String, Binary Search, Sliding Window, Prefix Sum
174 Max Consecutive Ones III 1004 Array, Binary Search, Sliding Window, Prefix Sum
175 Longest Repeating Character Replacement 424 Hash Table, String, Sliding Window
176 Minimum Operations to Make a Uni-Value Grid 2033 Array, Math, Sorting, Matrix
177 Stock Price Fluctuation 2034 Hash Table, Design, Heap (Priority Queue), Ordered Set
178 Bitwise AND of Numbers Range 201 Bit Manipulation
179 Search a 2D Matrix II 240 Array, Binary Search, Divide and Conquer, Matrix
180 Unique Paths 62 Math, Dynamic Programming, Combinatorics
181 Coin Change 322 Array, Dynamic Programming, Breadth-First Search
182 Construct Binary Search Tree from Preorder Traversal 1008 Array, Stack, Tree, Binary Search Tree, Monotonic Stack, Binary Tree
183 Perfect Squares 279 Math, Dynamic Programming, Breadth-First Search
184 Best Time to Buy and Sell Stock with Cooldown 309 Array, Dynamic Programming
185 Remove Colored Pieces if Both Neighbors are the Same Color 2038 Math, String, Greedy, Game Theory
186 The Time When the Network Becomes Idle 2039 Array, Breadth-First Search, Graph
187 Simple Bank System 2043 Array, Hash Table, Design, Simulation
188 Count Number of Maximum Bitwise-OR Subsets 2044 Array, Backtracking, Bit Manipulation
189 Path Sum III 437 Tree, Depth-First Search, Binary Tree
190 Factorial Trailing Zeroes 172 Math
191 Pow(x, n) 50 Math, Recursion
192 Sum of Two Integers 371 Math, Bit Manipulation
193 Reverse Words in a String 151 Two Pointers, String
194 Insert Delete GetRandom O(1) 380 Array, Hash Table, Math, Design, Randomized
195 Evaluate Reverse Polish Notation 150 Array, Math, Stack
196 Sort Characters By Frequency 451 Hash Table, String, Sorting, Heap (Priority Queue), Bucket Sort, Counting
197 Task Scheduler 621 Array, Hash Table, Greedy, Sorting, Heap (Priority Queue), Counting
198 Next Greater Numerically Balanced Number 2048
199 Count Nodes With the Highest Score 2049
200 Count Complete Tree Nodes 222 Binary Search, Tree, Depth-First Search, Binary Tree
201 Network Delay Time 743 Depth-First Search, Breadth-First Search, Graph, Heap (Priority Queue), Shortest Path
202 Path with Maximum Probability 1514 Graph, Heap (Priority Queue), Shortest Path
203 Path With Minimum Effort 1631 Array, Binary Search, Depth-First Search, Breadth-First Search, Union Find, Heap (Priority Queue), Matrix
204 Rotting Oranges 994 Array, Breadth-First Search, Matrix
205 Find the Minimum and Maximum Number of Nodes Between Critical Points 2058 Linked List
206 Minimum Operations to Convert Number 2059 Array, Breadth-First Search
207 Surrounded Regions 130 Array, Depth-First Search, Breadth-First Search, Union Find, Matrix
208 Sum Root to Leaf Numbers 129 Tree, Depth-First Search, Binary Tree
209 Two Best Non-Overlapping Events 2054 Array, Binary Search, Dynamic Programming, Sorting, Heap (Priority Queue)
210 Plates Between Candles 2055 Array, String, Binary Search, Prefix Sum
211 Single Number III 260 Array, Bit Manipulation
212 Vowels of All Substrings 2063 Math, String, Dynamic Programming, Combinatorics
213 Minimized Maximum of Products Distributed to Any Store 2064 Array, Binary Search
214 Multiply Strings 43 Math, String, Simulation
215 Unique Binary Search Trees 96 Math, Dynamic Programming, Tree, Binary Search Tree, Binary Tree
216 Daily Temperatures 739 Array, Stack, Monotonic Stack
217 Most Beautiful Item for Each Query 2070 Array, Binary Search, Sorting
218 Walking Robot Simulation II 2069 Design, Simulation
219 Reverse Nodes in Even Length Groups 2074 Linked List
220 Decode the Slanted Ciphertext 2075 String, Simulation
221 Iterator for Combination 1286 String, Backtracking, Design, Iterator
222 Expressive Words 809 Array, Two Pointers, String
223 Validate Stack Sequences 946 Array, Stack, Simulation
224 Largest Divisible Subset 368 Array, Math, Dynamic Programming, Sorting
225 Redundant Connection 684 Depth-First Search, Breadth-First Search, Union Find, Graph
226 Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit 1438 Array, Queue, Sliding Window, Heap (Priority Queue), Ordered Set, Monotonic Queue
227 Delete Nodes And Return Forest 1110 Tree, Depth-First Search, Binary Tree
228 Single Element in a Sorted Array 540 Array, Binary Search
229 Find Leaves of Binary Tree 366 Tree, Depth-First Search, Binary Tree
230 Construct Binary Tree from Inorder and Postorder Traversal 106 Array, Hash Table, Divide and Conquer, Tree, Binary Tree
231 Watering Plants 2079 Array
232 Range Frequency Queries 2080 Array, Binary Search
233 Longest Absolute File Path 388 String, Stack, Depth-First Search
234 Decode String 394 String, Stack, Recursion
235 Delete Node in a BST 450 Tree, Binary Search Tree, Binary Tree

Hard Questions

ID Problem Leetcode ID Categories
1 Find Minimum Time to Finish All Jobs 1723 Array, Dynamic Programming, Backtracking, Bit Manipulation, Bitmask
2 Building Boxes 1739 Math, Binary Search, Greedy
3 Minimum Degree of a Connected Trio in a Graph 1761 Graph
4 Maximize Palindrome Length From Subsequences 1771 String, Dynamic Programming
5 Number of Different Subsequences GCDs 1819 Array, Math, Counting, Number Theory
6 Finding MK Average 1825 Design, Queue, Heap (Priority Queue), Ordered Set
7 Find XOR Sum of All Pairs Bitwise AND 1835 Array, Math, Bit Manipulation
8 Maximum Building Height 1840 Array, Math
9 Minimum Interval to Include Each Query 1851 Array, Binary Search, Line Sweep, Sorting, Heap (Priority Queue)
10 Largest Color Value in a Directed Graph 1857 Hash Table, Dynamic Programming, Graph, Topological Sort, Memoization, Counting
11 Number of Ways to Rearrange Sticks With K Sticks Visible 1866 Math, Dynamic Programming, Combinatorics
12 Stone Game VIII 1872 Array, Math, Dynamic Programming, Prefix Sum, Game Theory
13 Minimum Skips to Arrive at Meeting On Time 1883 Array, Dynamic Programming
14 Minimum Space Wasted From Packaging 1889 Array, Binary Search, Sorting, Prefix Sum
15 Count Ways to Build Rooms in an Ant Colony 1916 Math, Dynamic Programming, Tree, Graph, Topological Sort, Combinatorics
16 Max Sum of Rectangle No Larger Than K 363 Array, Binary Search, Dynamic Programming, Matrix, Ordered Set
17 Count Vowels Permutation 1220 Dynamic Programming
18 Painting a Grid With Three Different Colors 1931 Dynamic Programming
19 Merge BSTs to Create Single BST 1932 Hash Table, Binary Search, Tree, Depth-First Search, Binary Tree
20 Three Equal Parts 927 Array, Math
21 Non-negative Integers without Consecutive Ones 600 Dynamic Programming
22 Number of Visible People in a Queue 1944 Array, Stack, Monotonic Stack
23 Trapping Rain Water 42 Array, Two Pointers, Dynamic Programming, Stack, Monotonic Stack
24 Count Number of Special Subsequences 1955 Array, Dynamic Programming
25 Making A Large Island 827 Array, Depth-First Search, Breadth-First Search, Union Find, Matrix
26 Palindrome Partitioning II 132 String, Dynamic Programming
27 Find the Longest Valid Obstacle Course at Each Position 1964 Array, Binary Search, Binary Indexed Tree
28 Word Ladder II 126 Hash Table, String, Backtracking, Breadth-First Search
29 Remove Boxes 546 Array, Dynamic Programming, Memoization
30 Last Day Where You Can Still Cross 1970 Array, Binary Search, Depth-First Search, Breadth-First Search, Union Find, Matrix
31 Minimum Window Substring 76 Hash Table, String, Sliding Window
32 Sudoku Solver 37 Array, Backtracking, Matrix
33 Rectangle Area II 850 Array, Segment Tree, Line Sweep, Ordered Set
34 Maximum Profit in Job Scheduling 1235 Array, Binary Search, Dynamic Programming, Sorting
35 Patching Array 330 Array, Greedy
36 Sum of Distances in Tree 834 Dynamic Programming, Tree, Depth-First Search, Graph
37 Orderly Queue 899 Math, String, Sorting
38 Basic Calculator 224 Math, String, Stack, Recursion
39 Arithmetic Slices II - Subsequence 446 Array, Dynamic Programming
40 Smallest Missing Genetic Value in Each Subtree 2003
41 Number of Unique Good Subsequences 1987 String, Dynamic Programming
42 Expression Add Operators 282 Math, String, Backtracking
43 Minimum Number of Operations to Make Array Continuous 2009 Array, Binary Search
44 Distinct Subsequences 115 String, Dynamic Programming
45 GCD Sort of an Array 1998 Array, Math, Union Find, Sorting
46 Shortest Path in a Grid with Obstacles Elimination 1293 Array, Breadth-First Search, Matrix
47 Dungeon Game 174 Array, Dynamic Programming, Matrix
48 Longest Subsequence Repeated k Times 2014 String, Backtracking, Greedy, Counting, Enumeration
49 Maximum Number of Ways to Partition an Array 2025 Array, Hash Table, Counting, Enumeration, Prefix Sum
50 Word Search II 212 Array, String, Backtracking, Trie, Matrix
51 Partition Array Into Two Arrays to Minimize Sum Difference 2035 Array, Two Pointers, Binary Search, Dynamic Programming, Bit Manipulation, Ordered Set, Bitmask
52 Second Minimum Time to Reach Destination 2045 Array, Breadth-First Search, Graph, Shortest Path
53 Best Time to Buy and Sell Stock III 123 Array, Dynamic Programming
54 Find Minimum in Rotated Sorted Array II 154 Array, Binary Search
55 Parallel Courses III 2050
56 Maximum Path Quality of a Graph 2065 Array, Backtracking, Graph
57 Number of Valid Words for Each Puzzle 1178 Array, Hash Table, String, Bit Manipulation, Trie
58 First Missing Positive 41 Array, Hash Table
59 Guess the Word 843 Array, Math, String, Interactive, Game Theory
60 Process Restricted Friend Requests 2076 Union Find, Graph
61 Kth Smallest Number in Multiplication Table 668 Binary Search
62 Text Justification 68 Array, String, Simulation
63 Sum of k-Mirror Numbers 2081

Categories

Array

ID Problem Leetcode ID Difficulty
1 Get Maximum in Generated Array 1646 Easy
2 Sell Diminishing-Valued Colored Balls 1648 Medium
3 Design an Ordered Stream 1656 Easy
4 Check If Two String Arrays are Equivalent 1662 Easy
5 Richest Customer Wealth 1672 Easy
6 Find the Most Competitive Subsequence 1673 Medium
7 Minimum Moves to Make Array Complementary 1674 Medium
8 Maximum Number of Eaten Apples 1705 Medium
9 Where Will the Ball Fall 1706 Medium
10 Maximum Units on a Truck 1710 Easy
11 Count Good Meals 1711 Medium
12 Decode XORed Array 1720 Easy
13 Minimize Hamming Distance After Swap Operations 1722 Medium
14 Find Minimum Time to Finish All Jobs 1723 Hard
15 Number Of Rectangles That Can Form The Largest Square 1725 Easy
16 Tuple with Same Product 1726 Medium
17 Largest Submatrix With Rearrangements 1727 Medium
18 Find Kth Largest XOR Coordinate Value 1738 Medium
19 Restore the Array From Adjacent Pairs 1743 Medium
20 Check if Array Is Sorted and Rotated 1752 Easy
21 Minimum Number of Operations to Move All Balls to Each Box 1769 Medium
22 Maximum Score from Performing Multiplication Operations 1770 Medium
23 Maximum Average Pass Ratio 1792 Medium
24 Maximum Ascending Subarray Sum 1800 Easy
25 Number of Orders in the Backlog 1801 Medium
26 Truncate Sentence 1816 Easy
27 Finding the Users Active Minutes 1817 Medium
28 Minimum Absolute Sum Difference 1818 Medium
29 Number of Different Subsequences GCDs 1819 Hard
30 Sign of the Product of an Array 1822 Easy
31 Find the Winner of the Circular Game 1823 Medium
32 Minimum Sideway Jumps 1824 Medium
33 Maximum Ice Cream Bars 1833 Medium
34 Single-Threaded CPU 1834 Medium
35 Find XOR Sum of All Pairs Bitwise AND 1835 Hard
36 Frequency of the Most Frequent Element 1838 Medium
37 Maximum Building Height 1840 Hard
38 Minimum Interval to Include Each Query 1851 Hard
39 Finding Pairs With a Certain Sum 1865 Medium
40 Minimum Distance to the Target Element 1848 Easy
41 Next Permutation 31 Medium
42 Maximum Distance Between a Pair of Values 1855 Medium
43 Maximum Subarray Min-Product 1856 Medium
44 Minimum Speed to Arrive on Time 1870 Medium
45 Maximum Population Year 1854 Easy
46 Process Tasks Using Servers 1882 Medium
47 Sum of All Subset XOR Totals 1863 Easy
48 Determine Whether Matrix Can Be Obtained By Rotation 1886 Easy
49 Stone Game VIII 1872 Hard
50 Merge Triplets to Form Target Triplet 1899 Medium
51 Minimum Skips to Arrive at Meeting On Time 1883 Hard
52 Count Sub Islands 1905 Medium
53 Minimum Absolute Difference Queries 1906 Medium
54 Reduction Operations to Make the Array Elements Equal 1887 Medium
55 Minimum Space Wasted From Packaging 1889 Hard
56 Maximum Product Difference Between Two Pairs 1913 Easy
57 Cyclically Rotating a Grid 1914 Medium
58 Maximum Number of Removable Characters 1898 Medium
59 Find K Closest Elements 658 Medium
60 Max Sum of Rectangle No Larger Than K 363 Hard
61 Build Array from Permutation 1920 Easy
62 Eliminate Maximum Number of Monsters 1921 Medium
63 Reshape the Matrix 566 Easy
64 Remove One Element to Make the Array Strictly Increasing 1909 Easy
65 Maximum Alternating Subsequence Sum 1911 Medium
66 Reduce Array Size to The Half 1338 Medium
67 Kth Smallest Element in a Sorted Matrix 378 Medium
68 Maximum Length of Repeated Subarray 718 Medium
69 Longest Increasing Subsequence 300 Medium
70 Concatenation of Array 1929 Easy
71 Find Peak Element 162 Medium
72 Valid Triangle Number 611 Medium
73 Nearest Exit from Entrance in Maze 1926 Medium
74 Three Equal Parts 927 Hard
75 Add Minimum Number of Rungs 1936 Medium
76 Maximum Number of Points with Cost 1937 Medium
77 Partition Array into Disjoint Intervals 915 Medium
78 Maximum Compatibility Score Sum 1947 Medium
79 3Sum Closest 16 Medium
80 Beautiful Array 932 Medium
81 01 Matrix 542 Medium
82 The Number of the Smallest Unoccupied Chair 1942 Medium
83 Describe the Painting 1943 Medium
84 Number of Visible People in a Queue 1944 Hard
85 Trapping Rain Water 42 Hard
86 Count Number of Special Subsequences 1955 Hard
87 Maximum Number of Weeks for Which You Can Work 1953 Medium
88 Making A Large Island 827 Hard
89 Subsets II 90 Medium
90 Combinations 77 Medium
91 Permutations 46 Medium
92 Permutations II 47 Medium
93 Stone Game 877 Medium
94 Subsets 78 Medium
95 Combination Sum 39 Medium
96 Combination Sum II 40 Medium
97 Remove Stones to Minimize the Total 1962 Medium
98 Find the Longest Valid Obstacle Course at Each Position 1964 Hard
99 Check If String Is a Prefix of Array 1961 Easy
100 Largest Number After Mutating Substring 1946 Medium
101 Array of Doubled Pairs 954 Medium
102 Set Matrix Zeroes 73 Medium
103 Remove Boxes 546 Hard
104 Array With Elements Not Equal to Average of Neighbors 1968 Medium
105 Last Day Where You Can Still Cross 1970 Hard
106 Range Sum Query - Immutable 303 Easy
107 Check if Move is Legal 1958 Medium
108 Minimum Total Space Wasted With K Resizing Operations 1959 Medium
109 Remove Duplicates from Sorted Array 26 Easy
110 Best Time to Buy and Sell Stock II 122 Medium
111 Rotate Array 189 Medium
112 Contains Duplicate 217 Easy
113 Single Number 136 Easy
114 Intersection of Two Arrays II 350 Easy
115 Intersection of Two Arrays 349 Easy
116 Plus One 66 Easy
117 Move Zeroes 283 Easy
118 Two Sum 1 Easy
119 Rotate Image 48 Medium
120 Valid Sudoku 36 Medium
121 Maximum Matrix Sum 1975 Medium
122 Find Greatest Common Divisor of Array 1979 Easy
123 Find Unique Binary String 1980 Medium
124 Minimize the Difference Between Target and Chosen Elements 1981 Medium
125 Sudoku Solver 37 Hard
126 Merge Intervals 56 Medium
127 Rectangle Area II 850 Hard
128 Longest Uncommon Subsequence II 522 Medium
129 Minimum Difference Between Highest and Lowest of K Scores 1984 Easy
130 Find the Kth Largest Integer in the Array 1985 Medium
131 Maximum Profit in Job Scheduling 1235 Hard
132 Minimum Number of Work Sessions to Finish the Tasks 1986 Medium
133 Range Addition II 598 Easy
134 Patching Array 330 Hard
135 Find Minimum in Rotated Sorted Array 153 Medium
136 Array Nesting 565 Medium
137 Convert Sorted Array to Binary Search Tree 108 Easy
138 Merge Sorted Array 88 Easy
139 Best Time to Buy and Sell Stock 121 Easy
140 Maximum Subarray 53 Easy
141 House Robber 198 Medium
142 Shuffle an Array 384 Medium
143 Find the Middle Index in Array 1991 Easy
144 Find All Groups of Farmland 1992 Medium
145 Slowest Key 1629 Easy
146 Count Primes 204 Easy
147 Shifting Letters 848 Medium
148 Largest Plus Sign 764 Medium
149 Pascal's Triangle 118 Easy
150 Missing Number 268 Easy
151 Arithmetic Slices II - Subsequence 446 Hard
152 Count Special Quadruplets 1995 Easy
153 First Day Where You Have Been in All the Rooms 1997 Medium
154 The Number of Weak Characters in the Game 1996 Medium
155 Longest Turbulent Subarray 978 Medium
156 Spiral Matrix 54 Medium
157 Count Number of Pairs With Absolute Difference K 2006 Easy
158 Find Original Array From Doubled Array 2007 Medium
159 Maximum Earnings From Taxi 2008 Medium
160 Minimum Number of Operations to Make Array Continuous 2009 Hard
161 Final Value of Variable After Performing Operations 2011 Easy
162 Sum of Beauty in the Array 2012 Medium
163 Detect Squares 2013 Medium
164 Find Winner on a Tic Tac Toe Game 1275 Easy
165 Max Consecutive Ones 485 Easy
166 3Sum 15 Medium
167 Increasing Triplet Subsequence 334 Medium
168 Maximum Length of a Concatenated String with Unique Characters 1239 Medium
169 GCD Sort of an Array 1998 Hard
170 Construct Binary Tree from Preorder and Inorder Traversal 105 Medium
171 Number of Islands 200 Medium
172 Word Search 79 Medium
173 Sort Colors 75 Medium
174 Top K Frequent Elements 347 Medium
175 Shortest Path in a Grid with Obstacles Elimination 1293 Hard
176 Maximum Difference Between Increasing Elements 2016 Easy
177 Grid Game 2017 Medium
178 Check if Word Can Be Placed In Crossword 2018 Medium
179 Unique Email Addresses 929 Easy
180 Sort Array By Parity II 922 Easy
181 Partition to K Equal Sum Subsets 698 Medium
182 Jump Game 55 Medium
183 Dungeon Game 174 Hard
184 Island Perimeter 463 Easy
185 Find All Duplicates in an Array 442 Medium
186 Kth Largest Element in an Array 215 Medium
187 Find First and Last Position of Element in Sorted Array 34 Medium
188 Search in Rotated Sorted Array 33 Medium
189 Convert 1D Array Into 2D Array 2022 Easy
190 Number of Pairs of Strings With Concatenation Equal to Target 2023 Medium
191 Max Consecutive Ones III 1004 Medium
192 Maximum Number of Ways to Partition an Array 2025 Hard
193 Word Search II 212 Hard
194 Two Out of Three 2032 Easy
195 Minimum Operations to Make a Uni-Value Grid 2033 Medium
196 Partition Array Into Two Arrays to Minimize Sum Difference 2035 Hard
197 Search a 2D Matrix II 240 Medium
198 Coin Change 322 Medium
199 Construct Binary Search Tree from Preorder Traversal 1008 Medium
200 Best Time to Buy and Sell Stock with Cooldown 309 Medium
201 Minimum Number of Moves to Seat Everyone 2037 Easy
202 The Time When the Network Becomes Idle 2039 Medium
203 Simple Bank System 2043 Medium
204 Count Number of Maximum Bitwise-OR Subsets 2044 Medium
205 Second Minimum Time to Reach Destination 2045 Hard
206 Best Time to Buy and Sell Stock III 123 Hard
207 Next Greater Element I 496 Easy
208 Insert Delete GetRandom O(1) 380 Medium
209 Evaluate Reverse Polish Notation 150 Medium
210 Majority Element 169 Easy
211 Task Scheduler 621 Medium
212 Find Minimum in Rotated Sorted Array II 154 Hard
213 Path With Minimum Effort 1631 Medium
214 Rotting Oranges 994 Medium
215 Smallest Index With Equal Value 2057 Easy
216 Minimum Operations to Convert Number 2059 Medium
217 Surrounded Regions 130 Medium
218 Kth Distinct String in an Array 2053 Easy
219 Two Best Non-Overlapping Events 2054 Medium
220 Plates Between Candles 2055 Medium
221 Single Number III 260 Medium
222 Minimized Maximum of Products Distributed to Any Store 2064 Medium
223 Maximum Path Quality of a Graph 2065 Hard
224 Number of Valid Words for Each Puzzle 1178 Hard
225 Minimum Value to Get Positive Step by Step Sum 1413 Easy
226 First Missing Positive 41 Hard
227 Daily Temperatures 739 Medium
228 Guess the Word 843 Hard
229 Most Beautiful Item for Each Query 2070 Medium
230 Time Needed to Buy Tickets 2073 Easy
231 Expressive Words 809 Medium
232 Validate Stack Sequences 946 Medium
233 Largest Divisible Subset 368 Medium
234 Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit 1438 Medium
235 Find All Numbers Disappeared in an Array 448 Easy
236 Text Justification 68 Hard
237 Single Element in a Sorted Array 540 Medium
238 Construct Binary Tree from Inorder and Postorder Traversal 106 Medium
239 Watering Plants 2079 Medium
240 Range Frequency Queries 2080 Medium

Backtracking

ID Problem Leetcode ID Difficulty
1 Find Minimum Time to Finish All Jobs 1723 Hard
2 Splitting a String Into Descending Consecutive Values 1849 Medium
3 Sum of All Subset XOR Totals 1863 Easy
4 Gray Code 89 Medium
5 Maximum Compatibility Score Sum 1947 Medium
6 Subsets II 90 Medium
7 Path Sum II 113 Medium
8 Combinations 77 Medium
9 Permutations 46 Medium
10 Permutations II 47 Medium
11 Subsets 78 Medium
12 Combination Sum 39 Medium
13 Combination Sum II 40 Medium
14 Word Ladder II 126 Hard
15 Find Unique Binary String 1980 Medium
16 Sudoku Solver 37 Hard
17 Minimum Number of Work Sessions to Finish the Tasks 1986 Medium
18 Unique Binary Search Trees II 95 Medium
19 Expression Add Operators 282 Hard
20 Maximum Length of a Concatenated String with Unique Characters 1239 Medium
21 Letter Combinations of a Phone Number 17 Medium
22 Generate Parentheses 22 Medium
23 Word Search 79 Medium
24 Partition to K Equal Sum Subsets 698 Medium
25 Longest Subsequence Repeated k Times 2014 Hard
26 Word Search II 212 Hard
27 Count Number of Maximum Bitwise-OR Subsets 2044 Medium
28 Maximum Path Quality of a Graph 2065 Hard
29 Iterator for Combination 1286 Medium

Binary Indexed Tree

ID Problem Leetcode ID Difficulty
1 Find the Longest Valid Obstacle Course at Each Position 1964 Hard

Binary Search

ID Problem Leetcode ID Difficulty
1 Sell Diminishing-Valued Colored Balls 1648 Medium
2 Building Boxes 1739 Hard
3 Minimum Absolute Sum Difference 1818 Medium
4 Frequency of the Most Frequent Element 1838 Medium
5 Minimum Interval to Include Each Query 1851 Hard
6 Maximum Distance Between a Pair of Values 1855 Medium
7 Minimum Speed to Arrive on Time 1870 Medium
8 Minimum Space Wasted From Packaging 1889 Hard
9 Maximum Number of Removable Characters 1898 Medium
10 Find K Closest Elements 658 Medium
11 Max Sum of Rectangle No Larger Than K 363 Hard
12 Kth Smallest Element in a Sorted Matrix 378 Medium
13 Maximum Length of Repeated Subarray 718 Medium
14 Longest Increasing Subsequence 300 Medium
15 Merge BSTs to Create Single BST 1932 Hard
16 Find Peak Element 162 Medium
17 Valid Triangle Number 611 Medium
18 Minimum Garden Perimeter to Collect Enough Apples 1954 Medium
19 Find the Longest Valid Obstacle Course at Each Position 1964 Hard
20 Last Day Where You Can Still Cross 1970 Hard
21 Intersection of Two Arrays II 350 Easy
22 Intersection of Two Arrays 349 Easy
23 Sum of Square Numbers 633 Medium
24 Maximum Profit in Job Scheduling 1235 Hard
25 Find Minimum in Rotated Sorted Array 153 Medium
26 First Bad Version 278 Easy
27 Maximum Earnings From Taxi 2008 Medium
28 Minimum Number of Operations to Make Array Continuous 2009 Hard
29 Find First and Last Position of Element in Sorted Array 34 Medium
30 Search in Rotated Sorted Array 33 Medium
31 Maximize the Confusion of an Exam 2024 Medium
32 Max Consecutive Ones III 1004 Medium
33 Partition Array Into Two Arrays to Minimize Sum Difference 2035 Hard
34 Search a 2D Matrix II 240 Medium
35 Guess Number Higher or Lower 374 Easy
36 Sqrt(x) 69 Easy
37 Find Minimum in Rotated Sorted Array II 154 Hard
38 Count Complete Tree Nodes 222 Medium
39 Path With Minimum Effort 1631 Medium
40 Arranging Coins 441 Easy
41 Two Best Non-Overlapping Events 2054 Medium
42 Plates Between Candles 2055 Medium
43 Minimized Maximum of Products Distributed to Any Store 2064 Medium
44 Most Beautiful Item for Each Query 2070 Medium
45 Kth Smallest Number in Multiplication Table 668 Hard
46 Single Element in a Sorted Array 540 Medium
47 Range Frequency Queries 2080 Medium

Binary Search Tree

ID Problem Leetcode ID Difficulty
1 Two Sum IV - Input is a BST 653 Easy
2 Validate Binary Search Tree 98 Medium
3 Convert Sorted Array to Binary Search Tree 108 Easy
4 Unique Binary Search Trees II 95 Medium
5 Kth Smallest Element in a BST 230 Medium
6 Construct Binary Search Tree from Preorder Traversal 1008 Medium
7 Unique Binary Search Trees 96 Medium
8 Delete Node in a BST 450 Medium

Binary Tree

ID Problem Leetcode ID Difficulty
1 Merge BSTs to Create Single BST 1932 Hard
2 Binary Tree Pruning 814 Medium
3 Path Sum II 113 Medium
4 Count Good Nodes in Binary Tree 1448 Medium
5 Maximum Product of Splitted Binary Tree 1339 Medium
6 Two Sum IV - Input is a BST 653 Easy
7 Verify Preorder Serialization of a Binary Tree 331 Medium
8 Maximum Depth of Binary Tree 104 Easy
9 Validate Binary Search Tree 98 Medium
10 Symmetric Tree 101 Easy
11 Binary Tree Level Order Traversal 102 Medium
12 Convert Sorted Array to Binary Search Tree 108 Easy
13 Unique Binary Search Trees II 95 Medium
14 Binary Tree Zigzag Level Order Traversal 103 Medium
15 Construct Binary Tree from Preorder and Inorder Traversal 105 Medium
16 Kth Smallest Element in a BST 230 Medium
17 Binary Tree Inorder Traversal 94 Easy
18 Subtree of Another Tree 572 Easy
19 Diameter of Binary Tree 543 Easy
20 Construct Binary Search Tree from Preorder Traversal 1008 Medium
21 Path Sum III 437 Medium
22 Cousins in Binary Tree 993 Easy
23 Count Complete Tree Nodes 222 Medium
24 Invert Binary Tree 226 Easy
25 Sum Root to Leaf Numbers 129 Medium
26 Sum of Left Leaves 404 Easy
27 Unique Binary Search Trees 96 Medium
28 Delete Nodes And Return Forest 1110 Medium
29 Find Leaves of Binary Tree 366 Medium
30 Construct Binary Tree from Inorder and Postorder Traversal 106 Medium
31 Delete Node in a BST 450 Medium

Bit Manipulation

ID Problem Leetcode ID Difficulty
1 Decode XORed Array 1720 Easy
2 Find Minimum Time to Finish All Jobs 1723 Hard
3 Find Kth Largest XOR Coordinate Value 1738 Medium
4 Find XOR Sum of All Pairs Bitwise AND 1835 Hard
5 Sum of All Subset XOR Totals 1863 Easy
6 Number of Wonderful Substrings 1915 Medium
7 Gray Code 89 Medium
8 Maximum Compatibility Score Sum 1947 Medium
9 Subsets II 90 Medium
10 Subsets 78 Medium
11 Single Number 136 Easy
12 Minimum Number of Work Sessions to Finish the Tasks 1986 Medium
13 Number of 1 Bits 191 Easy
14 Hamming Distance 461 Easy
15 Reverse Bits 190 Easy
16 Missing Number 268 Easy
17 Maximum Length of a Concatenated String with Unique Characters 1239 Medium
18 Partition to K Equal Sum Subsets 698 Medium
19 Partition Array Into Two Arrays to Minimize Sum Difference 2035 Hard
20 Bitwise AND of Numbers Range 201 Medium
21 Count Number of Maximum Bitwise-OR Subsets 2044 Medium
22 Sum of Two Integers 371 Medium
23 Single Number III 260 Medium
24 Number of Valid Words for Each Puzzle 1178 Hard

Bitmask

ID Problem Leetcode ID Difficulty
1 Find Minimum Time to Finish All Jobs 1723 Hard
2 Maximum Compatibility Score Sum 1947 Medium
3 Minimum Number of Work Sessions to Finish the Tasks 1986 Medium
4 Partition to K Equal Sum Subsets 698 Medium
5 Partition Array Into Two Arrays to Minimize Sum Difference 2035 Hard

Breadth-First Search

ID Problem Leetcode ID Difficulty
1 Count Sub Islands 1905 Medium
2 Nearest Exit from Entrance in Maze 1926 Medium
3 01 Matrix 542 Medium
4 Making A Large Island 827 Hard
5 Word Ladder II 126 Hard
6 Last Day Where You Can Still Cross 1970 Hard
7 Count Good Nodes in Binary Tree 1448 Medium
8 Two Sum IV - Input is a BST 653 Easy
9 Maximum Depth of Binary Tree 104 Easy
10 Symmetric Tree 101 Easy
11 Binary Tree Level Order Traversal 102 Medium
12 Find All Groups of Farmland 1992 Medium
13 Operations on Tree 1993 Medium
14 Binary Tree Zigzag Level Order Traversal 103 Medium
15 Number of Islands 200 Medium
16 Shortest Path in a Grid with Obstacles Elimination 1293 Hard
17 Island Perimeter 463 Easy
18 Coin Change 322 Medium
19 Perfect Squares 279 Medium
20 The Time When the Network Becomes Idle 2039 Medium
21 Second Minimum Time to Reach Destination 2045 Hard
22 Cousins in Binary Tree 993 Easy
23 Invert Binary Tree 226 Easy
24 Network Delay Time 743 Medium
25 Path With Minimum Effort 1631 Medium
26 Rotting Oranges 994 Medium
27 Minimum Operations to Convert Number 2059 Medium
28 Surrounded Regions 130 Medium
29 Sum of Left Leaves 404 Easy
30 Redundant Connection 684 Medium

Bucket Sort

ID Problem Leetcode ID Difficulty
1 Top K Frequent Elements 347 Medium
2 Sort Characters By Frequency 451 Medium

Combinatorics

ID Problem Leetcode ID Difficulty
1 Number of Ways to Rearrange Sticks With K Sticks Visible 1866 Hard
2 Count Ways to Build Rooms in an Ant Colony 1916 Hard
3 Unique Paths 62 Medium
4 Vowels of All Substrings 2063 Medium

Counting

ID Problem Leetcode ID Difficulty
1 Determine if String Halves Are Alike 1704 Easy
2 Change Minimum Characters to Satisfy One of Three Conditions 1737 Medium
3 Maximum Number of Balls in a Box 1742 Easy
4 Check if One String Swap Can Make Strings Equal 1790 Easy
5 Number of Different Subsequences GCDs 1819 Hard
6 Largest Color Value in a Directed Graph 1857 Hard
7 Maximum Population Year 1854 Easy
8 Redistribute Characters to Make All Strings Equal 1897 Easy
9 Check if All Characters Have Equal Number of Occurrences 1941 Easy
10 First Unique Character in a String 387 Easy
11 Maximum Number of Balloons 1189 Easy
12 Detect Squares 2013 Medium
13 Top K Frequent Elements 347 Medium
14 Longest Subsequence Repeated k Times 2014 Hard
15 Maximum Number of Ways to Partition an Array 2025 Hard
16 Majority Element 169 Easy
17 Sort Characters By Frequency 451 Medium
18 Task Scheduler 621 Medium
19 Kth Distinct String in an Array 2053 Easy
20 Check Whether Two Strings are Almost Equivalent 2068 Easy

Data Stream

ID Problem Leetcode ID Difficulty
1 Design an Ordered Stream 1656 Easy

Depth-First Search

ID Problem Leetcode ID Difficulty
1 Where Will the Ball Fall 1706 Medium
2 Minimize Hamming Distance After Swap Operations 1722 Medium
3 Count Sub Islands 1905 Medium
4 Merge BSTs to Create Single BST 1932 Hard
5 Binary Tree Pruning 814 Medium
6 Making A Large Island 827 Hard
7 Path Sum II 113 Medium
8 Last Day Where You Can Still Cross 1970 Hard
9 Count Good Nodes in Binary Tree 1448 Medium
10 Maximum Product of Splitted Binary Tree 1339 Medium
11 Two Sum IV - Input is a BST 653 Easy
12 Maximum Depth of Binary Tree 104 Easy
13 Validate Binary Search Tree 98 Medium
14 Symmetric Tree 101 Easy
15 Array Nesting 565 Medium
16 Sum of Distances in Tree 834 Hard
17 Find All Groups of Farmland 1992 Medium
18 Kth Smallest Element in a BST 230 Medium
19 Binary Tree Inorder Traversal 94 Easy
20 Number of Islands 200 Medium
21 Subtree of Another Tree 572 Easy
22 Island Perimeter 463 Easy
23 Diameter of Binary Tree 543 Easy
24 Path Sum III 437 Medium
25 Cousins in Binary Tree 993 Easy
26 Count Complete Tree Nodes 222 Medium
27 Invert Binary Tree 226 Easy
28 Network Delay Time 743 Medium
29 Path With Minimum Effort 1631 Medium
30 Surrounded Regions 130 Medium
31 Sum Root to Leaf Numbers 129 Medium
32 Sum of Left Leaves 404 Easy
33 Redundant Connection 684 Medium
34 Delete Nodes And Return Forest 1110 Medium
35 Find Leaves of Binary Tree 366 Medium
36 Longest Absolute File Path 388 Medium

Design

ID Problem Leetcode ID Difficulty
1 Design an Ordered Stream 1656 Easy
2 Finding MK Average 1825 Hard
3 Finding Pairs With a Certain Sum 1865 Medium
4 Map Sum Pairs 677 Medium
5 Range Sum Query - Immutable 303 Easy
6 Operations on Tree 1993 Medium
7 Min Stack 155 Easy
8 Detect Squares 2013 Medium
9 Implement Trie (Prefix Tree) 208 Medium
10 Stock Price Fluctuation 2034 Medium
11 Simple Bank System 2043 Medium
12 Insert Delete GetRandom O(1) 380 Medium
13 Walking Robot Simulation II 2069 Medium
14 Iterator for Combination 1286 Medium
15 Logger Rate Limiter 359 Easy

Divide and Conquer

ID Problem Leetcode ID Difficulty
1 Find Kth Largest XOR Coordinate Value 1738 Medium
2 Beautiful Array 932 Medium
3 Find the Kth Largest Integer in the Array 1985 Medium
4 Convert Sorted Array to Binary Search Tree 108 Easy
5 Maximum Subarray 53 Easy
6 Reverse Bits 190 Easy
7 Construct Binary Tree from Preorder and Inorder Traversal 105 Medium
8 Top K Frequent Elements 347 Medium
9 Kth Largest Element in an Array 215 Medium
10 Search a 2D Matrix II 240 Medium
11 Majority Element 169 Easy
12 Construct Binary Tree from Inorder and Postorder Traversal 106 Medium

Dynamic Programming

ID Problem Leetcode ID Difficulty
1 Get Maximum in Generated Array 1646 Easy
2 Where Will the Ball Fall 1706 Medium
3 Find Minimum Time to Finish All Jobs 1723 Hard
4 Maximum Score from Performing Multiplication Operations 1770 Medium
5 Maximize Palindrome Length From Subsequences 1771 Hard
6 Minimum Sideway Jumps 1824 Medium
7 Largest Color Value in a Directed Graph 1857 Hard
8 Number of Ways to Rearrange Sticks With K Sticks Visible 1866 Hard
9 Stone Game VIII 1872 Hard
10 Minimum Skips to Arrive at Meeting On Time 1883 Hard
11 Count Ways to Build Rooms in an Ant Colony 1916 Hard
12 Max Sum of Rectangle No Larger Than K 363 Hard
13 Count Vowels Permutation 1220 Hard
14 Maximum Alternating Subsequence Sum 1911 Medium
15 Maximum Length of Repeated Subarray 718 Medium
16 Longest Increasing Subsequence 300 Medium
17 Painting a Grid With Three Different Colors 1931 Hard
18 Maximum Number of Points with Cost 1937 Medium
19 Push Dominoes 838 Medium
20 Maximum Compatibility Score Sum 1947 Medium
21 Non-negative Integers without Consecutive Ones 600 Hard
22 01 Matrix 542 Medium
23 Trapping Rain Water 42 Hard
24 Count Number of Special Subsequences 1955 Hard
25 Stone Game 877 Medium
26 Palindrome Partitioning II 132 Hard
27 Flip String to Monotone Increasing 926 Medium
28 Remove Boxes 546 Hard
29 Minimum Total Space Wasted With K Resizing Operations 1959 Medium
30 Decode Ways 91 Medium
31 Best Time to Buy and Sell Stock II 122 Medium
32 Minimize the Difference Between Target and Chosen Elements 1981 Medium
33 Maximum Profit in Job Scheduling 1235 Hard
34 Minimum Number of Work Sessions to Finish the Tasks 1986 Medium
35 Unique Binary Search Trees II 95 Medium
36 Sum of Distances in Tree 834 Hard
37 Climbing Stairs 70 Easy
38 Best Time to Buy and Sell Stock 121 Easy
39 Maximum Subarray 53 Easy
40 House Robber 198 Medium
41 Largest Plus Sign 764 Medium
42 Pascal's Triangle 118 Easy
43 Arithmetic Slices II - Subsequence 446 Hard
44 First Day Where You Have Been in All the Rooms 1997 Medium
45 Number of Unique Good Subsequences 1987 Hard
46 Longest Turbulent Subarray 978 Medium
47 Maximum Earnings From Taxi 2008 Medium
48 Distinct Subsequences 115 Hard
49 Longest Palindromic Substring 5 Medium
50 Generate Parentheses 22 Medium
51 N-th Tribonacci Number 1137 Easy
52 Partition to K Equal Sum Subsets 698 Medium
53 Longest Common Subsequence 1143 Medium
54 Jump Game 55 Medium
55 Dungeon Game 174 Hard
56 Partition Array Into Two Arrays to Minimize Sum Difference 2035 Hard
57 Unique Paths 62 Medium
58 Coin Change 322 Medium
59 Perfect Squares 279 Medium
60 Best Time to Buy and Sell Stock with Cooldown 309 Medium
61 Best Time to Buy and Sell Stock III 123 Hard
62 Two Best Non-Overlapping Events 2054 Medium
63 Vowels of All Substrings 2063 Medium
64 Unique Binary Search Trees 96 Medium
65 Largest Divisible Subset 368 Medium

Enumeration

ID Problem Leetcode ID Difficulty
1 Count Square Sum Triples 1925 Easy
2 Check if Move is Legal 1958 Medium
3 Count Primes 204 Easy
4 Count Special Quadruplets 1995 Easy
5 Check if Word Can Be Placed In Crossword 2018 Medium
6 Longest Subsequence Repeated k Times 2014 Hard
7 Maximum Number of Ways to Partition an Array 2025 Hard

Game Theory

ID Problem Leetcode ID Difficulty
1 Stone Game VIII 1872 Hard
2 Sum Game 1927 Medium
3 Stone Game 877 Medium
4 Remove Colored Pieces if Both Neighbors are the Same Color 2038 Medium
5 Guess the Word 843 Hard

Graph

ID Problem Leetcode ID Difficulty
1 Minimum Degree of a Connected Trio in a Graph 1761 Hard
2 Find Center of Star Graph 1791 Easy
3 Largest Color Value in a Directed Graph 1857 Hard
4 Count Ways to Build Rooms in an Ant Colony 1916 Hard
5 Sum of Distances in Tree 834 Hard
6 The Time When the Network Becomes Idle 2039 Medium
7 Second Minimum Time to Reach Destination 2045 Hard
8 Network Delay Time 743 Medium
9 Path with Maximum Probability 1514 Medium
10 Maximum Path Quality of a Graph 2065 Hard
11 Process Restricted Friend Requests 2076 Hard
12 Redundant Connection 684 Medium

Greedy

ID Problem Leetcode ID Difficulty
1 Minimum Deletions to Make Character Frequencies Unique 1647 Medium
2 Sell Diminishing-Valued Colored Balls 1648 Medium
3 Smallest String With A Given Numeric Value 1663 Medium
4 Find the Most Competitive Subsequence 1673 Medium
5 Partitioning Into Minimum Number Of Deci-Binary Numbers 1689 Medium
6 Maximum Number of Eaten Apples 1705 Medium
7 Maximum Units on a Truck 1710 Easy
8 Largest Submatrix With Rearrangements 1727 Medium
9 Latest Time by Replacing Hidden Digits 1736 Easy
10 Building Boxes 1739 Hard
11 Maximum Average Pass Ratio 1792 Medium
12 Minimum Sideway Jumps 1824 Medium
13 Maximum Ice Cream Bars 1833 Medium
14 Frequency of the Most Frequent Element 1838 Medium
15 Minimum Number of Swaps to Make the Binary String Alternating 1864 Medium
16 Minimum Adjacent Swaps to Reach the Kth Smallest Number 1850 Medium
17 Maximum Distance Between a Pair of Values 1855 Medium
18 Merge Triplets to Form Target Triplet 1899 Medium
19 Maximum Value after Insertion 1881 Medium
20 Largest Odd Number in String 1903 Easy
21 Minimum Number of Flips to Make the Binary String Alternating 1888 Medium
22 Eliminate Maximum Number of Monsters 1921 Medium
23 Reduce Array Size to The Half 1338 Medium
24 Valid Triangle Number 611 Medium
25 Sum Game 1927 Medium
26 Add Minimum Number of Rungs 1936 Medium
27 Maximum Number of Weeks for Which You Can Work 1953 Medium
28 Minimum Number of Swaps to Make the String Balanced 1963 Medium
29 Largest Number After Mutating Substring 1946 Medium
30 Array of Doubled Pairs 954 Medium
31 Array With Elements Not Equal to Average of Neighbors 1968 Medium
32 Minimum Non-Zero Product of the Array Elements 1969 Medium
33 Best Time to Buy and Sell Stock II 122 Medium
34 Minimum Time to Type Word Using Special Typewriter 1974 Easy
35 Maximum Matrix Sum 1975 Medium
36 Patching Array 330 Hard
37 The Number of Weak Characters in the Game 1996 Medium
38 Find Original Array From Doubled Array 2007 Medium
39 Increasing Triplet Subsequence 334 Medium
40 Break a Palindrome 1328 Medium
41 Jump Game 55 Medium
42 Longest Subsequence Repeated k Times 2014 Hard
43 Remove Colored Pieces if Both Neighbors are the Same Color 2038 Medium
44 Task Scheduler 621 Medium

Hash Function

ID Problem Leetcode ID Difficulty
1 Maximum Length of Repeated Subarray 718 Medium
2 Subtree of Another Tree 572 Easy

Hash Table

ID Problem Leetcode ID Difficulty
1 Design an Ordered Stream 1656 Easy
2 Determine if Two Strings Are Close 1657 Medium
3 Minimum Moves to Make Array Complementary 1674 Medium
4 Count Good Meals 1711 Medium
5 Tuple with Same Product 1726 Medium
6 Change Minimum Characters to Satisfy One of Three Conditions 1737 Medium
7 Maximum Number of Balls in a Box 1742 Easy
8 Restore the Array From Adjacent Pairs 1743 Medium
9 Check if One String Swap Can Make Strings Equal 1790 Easy
10 Number of Different Integers in a String 1805 Easy
11 Finding the Users Active Minutes 1817 Medium
12 Check if the Sentence Is Pangram 1832 Easy
13 Finding Pairs With a Certain Sum 1865 Medium
14 Largest Color Value in a Directed Graph 1857 Hard
15 Redistribute Characters to Make All Strings Equal 1897 Easy
16 Minimum Absolute Difference Queries 1906 Medium
17 Number of Wonderful Substrings 1915 Medium
18 Reduce Array Size to The Half 1338 Medium
19 Merge BSTs to Create Single BST 1932 Hard
20 Unique Length-3 Palindromic Subsequences 1930 Medium
21 Isomorphic Strings 205 Easy
22 Custom Sort String 791 Medium
23 Maximum Number of Words You Can Type 1935 Easy
24 Map Sum Pairs 677 Medium
25 Check if All Characters Have Equal Number of Occurrences 1941 Easy
26 Array of Doubled Pairs 954 Medium
27 Group Anagrams 49 Medium
28 Set Matrix Zeroes 73 Medium
29 Word Ladder II 126 Hard
30 Minimum Window Substring 76 Hard
31 Contains Duplicate 217 Easy
32 Intersection of Two Arrays II 350 Easy
33 Intersection of Two Arrays 349 Easy
34 Two Sum 1 Easy
35 Valid Sudoku 36 Medium
36 First Unique Character in a String 387 Easy
37 Valid Anagram 242 Easy
38 Two Sum IV - Input is a BST 653 Easy
39 Longest Uncommon Subsequence II 522 Medium
40 Linked List Cycle 141 Easy
41 Operations on Tree 1993 Medium
42 Roman to Integer 13 Easy
43 Missing Number 268 Easy
44 Maximum Number of Balloons 1189 Easy
45 Find Original Array From Doubled Array 2007 Medium
46 Detect Squares 2013 Medium
47 Find Winner on a Tic Tac Toe Game 1275 Easy
48 Longest Substring Without Repeating Characters 3 Medium
49 Intersection of Two Linked Lists 160 Easy
50 Construct Binary Tree from Preorder and Inorder Traversal 105 Medium
51 Letter Combinations of a Phone Number 17 Medium
52 Top K Frequent Elements 347 Medium
53 Unique Email Addresses 929 Easy
54 Find All Duplicates in an Array 442 Medium
55 Implement Trie (Prefix Tree) 208 Medium
56 Longest Repeating Character Replacement 424 Medium
57 Maximum Number of Ways to Partition an Array 2025 Hard
58 Two Out of Three 2032 Easy
59 Stock Price Fluctuation 2034 Medium
60 Simple Bank System 2043 Medium
61 Happy Number 202 Easy
62 Next Greater Element I 496 Easy
63 Insert Delete GetRandom O(1) 380 Medium
64 Majority Element 169 Easy
65 Sort Characters By Frequency 451 Medium
66 Task Scheduler 621 Medium
67 Kth Distinct String in an Array 2053 Easy
68 Number of Valid Words for Each Puzzle 1178 Hard
69 First Missing Positive 41 Hard
70 Check Whether Two Strings are Almost Equivalent 2068 Easy
71 Find All Numbers Disappeared in an Array 448 Easy
72 Logger Rate Limiter 359 Easy
73 Construct Binary Tree from Inorder and Postorder Traversal 106 Medium
74 Count Vowel Substrings of a String 2062 Easy

Heap (Priority Queue)

ID Problem Leetcode ID Difficulty
1 Sell Diminishing-Valued Colored Balls 1648 Medium
2 Maximum Number of Eaten Apples 1705 Medium
3 Find Kth Largest XOR Coordinate Value 1738 Medium
4 Maximum Average Pass Ratio 1792 Medium
5 Number of Orders in the Backlog 1801 Medium
6 Finding MK Average 1825 Hard
7 Single-Threaded CPU 1834 Medium
8 Minimum Interval to Include Each Query 1851 Hard
9 Process Tasks Using Servers 1882 Medium
10 Find K Closest Elements 658 Medium
11 Reduce Array Size to The Half 1338 Medium
12 Kth Smallest Element in a Sorted Matrix 378 Medium
13 The Number of the Smallest Unoccupied Chair 1942 Medium
14 Remove Stones to Minimize the Total 1962 Medium
15 Find the Kth Largest Integer in the Array 1985 Medium
16 Top K Frequent Elements 347 Medium
17 Kth Largest Element in an Array 215 Medium
18 Stock Price Fluctuation 2034 Medium
19 Sort Characters By Frequency 451 Medium
20 Task Scheduler 621 Medium
21 Network Delay Time 743 Medium
22 Path with Maximum Probability 1514 Medium
23 Path With Minimum Effort 1631 Medium
24 Two Best Non-Overlapping Events 2054 Medium
25 Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit 1438 Medium

Interactive

ID Problem Leetcode ID Difficulty
1 First Bad Version 278 Easy
2 Guess Number Higher or Lower 374 Easy
3 Guess the Word 843 Hard

Iterator

ID Problem Leetcode ID Difficulty
1 Iterator for Combination 1286 Medium

Line Sweep

ID Problem Leetcode ID Difficulty
1 Minimum Interval to Include Each Query 1851 Hard
2 Rectangle Area II 850 Hard

Linked List

ID Problem Leetcode ID Difficulty
1 Swapping Nodes in a Linked List 1721 Medium
2 Delete Node in a Linked List 237 Easy
3 Remove Nth Node From End of List 19 Medium
4 Merge Two Sorted Lists 21 Easy
5 Palindrome Linked List 234 Easy
6 Linked List Cycle 141 Easy
7 Reverse Linked List 206 Easy
8 Add Two Numbers 2 Medium
9 Odd Even Linked List 328 Medium
10 Intersection of Two Linked Lists 160 Easy
11 Split Linked List in Parts 725 Medium
12 Find the Minimum and Maximum Number of Nodes Between Critical Points 2058 Medium
13 Remove Linked List Elements 203 Easy
14 Reverse Nodes in Even Length Groups 2074 Medium

Math

ID Problem Leetcode ID Difficulty
1 Sell Diminishing-Valued Colored Balls 1648 Medium
2 Count of Matches in Tournament 1688 Easy
3 Building Boxes 1739 Hard
4 Maximum Number of Balls in a Box 1742 Easy
5 Count Number of Homogenous Substrings 1759 Medium
6 Number of Different Subsequences GCDs 1819 Hard
7 Sign of the Product of an Array 1822 Easy
8 Find the Winner of the Circular Game 1823 Medium
9 Find XOR Sum of All Pairs Bitwise AND 1835 Hard
10 Sum of Digits in Base K 1837 Easy
11 Maximum Building Height 1840 Hard
12 Number of Ways to Rearrange Sticks With K Sticks Visible 1866 Hard
13 Stone Game VIII 1872 Hard
14 Largest Odd Number in String 1903 Easy
15 Count Ways to Build Rooms in an Ant Colony 1916 Hard
16 Count Good Numbers 1922 Medium
17 Gray Code 89 Medium
18 The Number of Full Rounds You Have Played 1904 Medium
19 Count Square Sum Triples 1925 Easy
20 Sum Game 1927 Medium
21 Three Equal Parts 927 Hard
22 Beautiful Array 932 Medium
23 Three Divisors 1952 Easy
24 Minimum Garden Perimeter to Collect Enough Apples 1954 Medium
25 Stone Game 877 Medium
26 Add Strings 415 Easy
27 Minimum Non-Zero Product of the Array Elements 1969 Medium
28 Rotate Array 189 Medium
29 Plus One 66 Easy
30 Rotate Image 48 Medium
31 Reverse Integer 7 Easy
32 Find Greatest Common Divisor of Array 1979 Easy
33 Complex Number Multiplication 537 Medium
34 Sum of Square Numbers 633 Medium
35 Range Addition II 598 Easy
36 Climbing Stairs 70 Easy
37 Shuffle an Array 384 Medium
38 Orderly Queue 899 Hard
39 Fizz Buzz 412 Easy
40 Count Primes 204 Easy
41 Power of Three 326 Easy
42 Roman to Integer 13 Easy
43 Missing Number 268 Easy
44 Basic Calculator 224 Hard
45 Expression Add Operators 282 Hard
46 Add Two Numbers 2 Medium
47 GCD Sort of an Array 1998 Hard
48 N-th Tribonacci Number 1137 Easy
49 Minimum Operations to Make a Uni-Value Grid 2033 Medium
50 Unique Paths 62 Medium
51 Perfect Squares 279 Medium
52 Remove Colored Pieces if Both Neighbors are the Same Color 2038 Medium
53 Happy Number 202 Easy
54 Factorial Trailing Zeroes 172 Medium
55 Excel Sheet Column Number 171 Easy
56 Pow(x, n) 50 Medium
57 Sqrt(x) 69 Easy
58 Sum of Two Integers 371 Medium
59 Insert Delete GetRandom O(1) 380 Medium
60 Evaluate Reverse Polish Notation 150 Medium
61 Arranging Coins 441 Easy
62 Vowels of All Substrings 2063 Medium
63 Multiply Strings 43 Medium
64 Unique Binary Search Trees 96 Medium
65 Guess the Word 843 Hard
66 Largest Divisible Subset 368 Medium

Matrix

ID Problem Leetcode ID Difficulty
1 Richest Customer Wealth 1672 Easy
2 Where Will the Ball Fall 1706 Medium
3 Largest Submatrix With Rearrangements 1727 Medium
4 Find Kth Largest XOR Coordinate Value 1738 Medium
5 Determine Whether Matrix Can Be Obtained By Rotation 1886 Easy
6 Count Sub Islands 1905 Medium
7 Cyclically Rotating a Grid 1914 Medium
8 Max Sum of Rectangle No Larger Than K 363 Hard
9 Reshape the Matrix 566 Easy
10 Kth Smallest Element in a Sorted Matrix 378 Medium
11 Nearest Exit from Entrance in Maze 1926 Medium
12 01 Matrix 542 Medium
13 Making A Large Island 827 Hard
14 Set Matrix Zeroes 73 Medium
15 Last Day Where You Can Still Cross 1970 Hard
16 Check if Move is Legal 1958 Medium
17 Rotate Image 48 Medium
18 Valid Sudoku 36 Medium
19 Maximum Matrix Sum 1975 Medium
20 Minimize the Difference Between Target and Chosen Elements 1981 Medium
21 Sudoku Solver 37 Hard
22 Find All Groups of Farmland 1992 Medium
23 Spiral Matrix 54 Medium
24 Find Winner on a Tic Tac Toe Game 1275 Easy
25 Number of Islands 200 Medium
26 Word Search 79 Medium
27 Shortest Path in a Grid with Obstacles Elimination 1293 Hard
28 Grid Game 2017 Medium
29 Check if Word Can Be Placed In Crossword 2018 Medium
30 Dungeon Game 174 Hard
31 Island Perimeter 463 Easy
32 Convert 1D Array Into 2D Array 2022 Easy
33 Word Search II 212 Hard
34 Minimum Operations to Make a Uni-Value Grid 2033 Medium
35 Search a 2D Matrix II 240 Medium
36 Path With Minimum Effort 1631 Medium
37 Rotting Oranges 994 Medium
38 Surrounded Regions 130 Medium

Memoization

ID Problem Leetcode ID Difficulty
1 Largest Color Value in a Directed Graph 1857 Hard
2 Remove Boxes 546 Hard
3 Climbing Stairs 70 Easy
4 N-th Tribonacci Number 1137 Easy
5 Partition to K Equal Sum Subsets 698 Medium

Monotonic Queue

ID Problem Leetcode ID Difficulty
1 Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit 1438 Medium

Monotonic Stack

ID Problem Leetcode ID Difficulty
1 Find the Most Competitive Subsequence 1673 Medium
2 Maximum Subarray Min-Product 1856 Medium
3 Number of Visible People in a Queue 1944 Hard
4 Trapping Rain Water 42 Hard
5 The Number of Weak Characters in the Game 1996 Medium
6 Construct Binary Search Tree from Preorder Traversal 1008 Medium
7 Next Greater Element I 496 Easy
8 Daily Temperatures 739 Medium

Number Theory

ID Problem Leetcode ID Difficulty
1 Number of Different Subsequences GCDs 1819 Hard
2 Count Primes 204 Easy

Ordered Set

ID Problem Leetcode ID Difficulty
1 Minimum Absolute Sum Difference 1818 Medium
2 Finding MK Average 1825 Hard
3 Max Sum of Rectangle No Larger Than K 363 Hard
4 The Number of the Smallest Unoccupied Chair 1942 Medium
5 Rectangle Area II 850 Hard
6 Stock Price Fluctuation 2034 Medium
7 Partition Array Into Two Arrays to Minimize Sum Difference 2035 Hard
8 Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit 1438 Medium

Prefix Sum

ID Problem Leetcode ID Difficulty
1 Minimum Moves to Make Array Complementary 1674 Medium
2 Change Minimum Characters to Satisfy One of Three Conditions 1737 Medium
3 Find Kth Largest XOR Coordinate Value 1738 Medium
4 Frequency of the Most Frequent Element 1838 Medium
5 Maximum Subarray Min-Product 1856 Medium
6 Jump Game VII 1871 Medium
7 Stone Game VIII 1872 Hard
8 Minimum Space Wasted From Packaging 1889 Hard
9 Number of Wonderful Substrings 1915 Medium
10 Unique Length-3 Palindromic Subsequences 1930 Medium
11 Describe the Painting 1943 Medium
12 Range Sum Query - Immutable 303 Easy
13 Find the Middle Index in Array 1991 Easy
14 Grid Game 2017 Medium
15 Maximize the Confusion of an Exam 2024 Medium
16 Max Consecutive Ones III 1004 Medium
17 Maximum Number of Ways to Partition an Array 2025 Hard
18 Plates Between Candles 2055 Medium
19 Minimum Value to Get Positive Step by Step Sum 1413 Easy

Queue

ID Problem Leetcode ID Difficulty
1 Find the Winner of the Circular Game 1823 Medium
2 Finding MK Average 1825 Hard
3 First Unique Character in a String 387 Easy
4 Time Needed to Buy Tickets 2073 Easy
5 Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit 1438 Medium

Quickselect

ID Problem Leetcode ID Difficulty
1 Find Kth Largest XOR Coordinate Value 1738 Medium
2 Find the Kth Largest Integer in the Array 1985 Medium
3 Top K Frequent Elements 347 Medium
4 Kth Largest Element in an Array 215 Medium

Randomized

ID Problem Leetcode ID Difficulty
1 Shuffle an Array 384 Medium
2 Insert Delete GetRandom O(1) 380 Medium

Recursion

ID Problem Leetcode ID Difficulty
1 Find the Winner of the Circular Game 1823 Medium
2 Count Good Numbers 1922 Medium
3 Minimum Non-Zero Product of the Array Elements 1969 Medium
4 Reverse String 344 Easy
5 Merge Two Sorted Lists 21 Easy
6 Palindrome Linked List 234 Easy
7 Reverse Linked List 206 Easy
8 Power of Three 326 Easy
9 Basic Calculator 224 Hard
10 Add Two Numbers 2 Medium
11 Pow(x, n) 50 Medium
12 Remove Linked List Elements 203 Easy
13 Decode String 394 Medium

Rolling Hash

ID Problem Leetcode ID Difficulty
1 Maximum Length of Repeated Subarray 718 Medium

Segment Tree

ID Problem Leetcode ID Difficulty
1 Rectangle Area II 850 Hard

Shortest Path

ID Problem Leetcode ID Difficulty
1 Second Minimum Time to Reach Destination 2045 Hard
2 Network Delay Time 743 Medium
3 Path with Maximum Probability 1514 Medium

Simulation

ID Problem Leetcode ID Difficulty
1 Get Maximum in Generated Array 1646 Easy
2 Count of Matches in Tournament 1688 Easy
3 Where Will the Ball Fall 1706 Medium
4 Number of Orders in the Backlog 1801 Medium
5 Find the Winner of the Circular Game 1823 Medium
6 Cyclically Rotating a Grid 1914 Medium
7 Build Array from Permutation 1920 Easy
8 Reshape the Matrix 566 Easy
9 Sum of Digits of String After Convert 1945 Easy
10 Add Strings 415 Easy
11 Complex Number Multiplication 537 Medium
12 Fizz Buzz 412 Easy
13 Spiral Matrix 54 Medium
14 Final Value of Variable After Performing Operations 2011 Easy
15 Find Winner on a Tic Tac Toe Game 1275 Easy
16 Convert 1D Array Into 2D Array 2022 Easy
17 Simple Bank System 2043 Medium
18 Multiply Strings 43 Medium
19 Walking Robot Simulation II 2069 Medium
20 Time Needed to Buy Tickets 2073 Easy
21 Decode the Slanted Ciphertext 2075 Medium
22 Validate Stack Sequences 946 Medium
23 Text Justification 68 Hard

Sliding Window

ID Problem Leetcode ID Difficulty
1 Frequency of the Most Frequent Element 1838 Medium
2 Longest Substring Of All Vowels in Order 1839 Medium
3 Maximum Length of Repeated Subarray 718 Medium
4 Minimum Window Substring 76 Hard
5 Longest Turbulent Subarray 978 Medium
6 Longest Substring Without Repeating Characters 3 Medium
7 Maximize the Confusion of an Exam 2024 Medium
8 Max Consecutive Ones III 1004 Medium
9 Longest Repeating Character Replacement 424 Medium
10 Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit 1438 Medium

Sorting

ID Problem Leetcode ID Difficulty
1 Minimum Deletions to Make Character Frequencies Unique 1647 Medium
2 Sell Diminishing-Valued Colored Balls 1648 Medium
3 Determine if Two Strings Are Close 1657 Medium
4 Maximum Units on a Truck 1710 Easy
5 Largest Submatrix With Rearrangements 1727 Medium
6 Minimum Absolute Sum Difference 1818 Medium
7 Maximum Ice Cream Bars 1833 Medium
8 Single-Threaded CPU 1834 Medium
9 Frequency of the Most Frequent Element 1838 Medium
10 Minimum Interval to Include Each Query 1851 Hard
11 Reduction Operations to Make the Array Elements Equal 1887 Medium
12 Minimum Space Wasted From Packaging 1889 Hard
13 Maximum Product Difference Between Two Pairs 1913 Easy
14 Find K Closest Elements 658 Medium
15 Eliminate Maximum Number of Monsters 1921 Medium
16 Reduce Array Size to The Half 1338 Medium
17 Kth Smallest Element in a Sorted Matrix 378 Medium
18 Custom Sort String 791 Medium
19 Valid Triangle Number 611 Medium
20 3Sum Closest 16 Medium
21 Array of Doubled Pairs 954 Medium
22 Group Anagrams 49 Medium
23 Array With Elements Not Equal to Average of Neighbors 1968 Medium
24 Contains Duplicate 217 Easy
25 Intersection of Two Arrays II 350 Easy
26 Intersection of Two Arrays 349 Easy
27 Valid Anagram 242 Easy
28 Merge Intervals 56 Medium
29 Longest Uncommon Subsequence II 522 Medium
30 Minimum Difference Between Highest and Lowest of K Scores 1984 Easy
31 Find the Kth Largest Integer in the Array 1985 Medium
32 Maximum Profit in Job Scheduling 1235 Hard
33 Merge Sorted Array 88 Easy
34 Orderly Queue 899 Hard
35 Missing Number 268 Easy
36 The Number of Weak Characters in the Game 1996 Medium
37 Find Original Array From Doubled Array 2007 Medium
38 Maximum Earnings From Taxi 2008 Medium
39 3Sum 15 Medium
40 GCD Sort of an Array 1998 Hard
41 Sort Colors 75 Medium
42 Top K Frequent Elements 347 Medium
43 Sort Array By Parity II 922 Easy
44 Kth Largest Element in an Array 215 Medium
45 Minimum Operations to Make a Uni-Value Grid 2033 Medium
46 Minimum Number of Moves to Seat Everyone 2037 Easy
47 Majority Element 169 Easy
48 Sort Characters By Frequency 451 Medium
49 Task Scheduler 621 Medium
50 Two Best Non-Overlapping Events 2054 Medium
51 Most Beautiful Item for Each Query 2070 Medium
52 Largest Divisible Subset 368 Medium

Stack

ID Problem Leetcode ID Difficulty
1 Find the Most Competitive Subsequence 1673 Medium
2 Maximum Subarray Min-Product 1856 Medium
3 Number of Visible People in a Queue 1944 Hard
4 Trapping Rain Water 42 Hard
5 Minimum Number of Swaps to Make the String Balanced 1963 Medium
6 Verify Preorder Serialization of a Binary Tree 331 Medium
7 Palindrome Linked List 234 Easy
8 Min Stack 155 Easy
9 Valid Parentheses 20 Easy
10 Basic Calculator 224 Hard
11 The Number of Weak Characters in the Game 1996 Medium
12 Binary Tree Inorder Traversal 94 Easy
13 Construct Binary Search Tree from Preorder Traversal 1008 Medium
14 Next Greater Element I 496 Easy
15 Evaluate Reverse Polish Notation 150 Medium
16 Daily Temperatures 739 Medium
17 Validate Stack Sequences 946 Medium
18 Longest Absolute File Path 388 Medium
19 Decode String 394 Medium

String

ID Problem Leetcode ID Difficulty
1 Minimum Deletions to Make Character Frequencies Unique 1647 Medium
2 Determine if Two Strings Are Close 1657 Medium
3 Check If Two String Arrays are Equivalent 1662 Easy
4 Smallest String With A Given Numeric Value 1663 Medium
5 Partitioning Into Minimum Number Of Deci-Binary Numbers 1689 Medium
6 Determine if String Halves Are Alike 1704 Easy
7 Latest Time by Replacing Hidden Digits 1736 Easy
8 Change Minimum Characters to Satisfy One of Three Conditions 1737 Medium
9 Minimum Changes To Make Alternating Binary String 1758 Easy
10 Count Number of Homogenous Substrings 1759 Medium
11 Merge Strings Alternately 1768 Easy
12 Minimum Number of Operations to Move All Balls to Each Box 1769 Medium
13 Maximize Palindrome Length From Subsequences 1771 Hard
14 Check if Binary String Has at Most One Segment of Ones 1784 Easy
15 Check if One String Swap Can Make Strings Equal 1790 Easy
16 Number of Different Integers in a String 1805 Easy
17 Truncate Sentence 1816 Easy
18 Check if the Sentence Is Pangram 1832 Easy
19 Longest Substring Of All Vowels in Order 1839 Medium
20 Minimum Number of Swaps to Make the Binary String Alternating 1864 Medium
21 Splitting a String Into Descending Consecutive Values 1849 Medium
22 Minimum Adjacent Swaps to Reach the Kth Smallest Number 1850 Medium
23 Longer Contiguous Segments of Ones than Zeros 1869 Easy
24 Jump Game VII 1871 Medium
25 Redistribute Characters to Make All Strings Equal 1897 Easy
26 Check if Word Equals Summation of Two Words 1880 Easy
27 Maximum Value after Insertion 1881 Medium
28 Largest Odd Number in String 1903 Easy
29 Minimum Number of Flips to Make the Binary String Alternating 1888 Medium
30 Number of Wonderful Substrings 1915 Medium
31 Maximum Number of Removable Characters 1898 Medium
32 Remove All Occurrences of a Substring 1910 Medium
33 The Number of Full Rounds You Have Played 1904 Medium
34 Unique Length-3 Palindromic Subsequences 1930 Medium
35 Isomorphic Strings 205 Easy
36 Custom Sort String 791 Medium
37 Maximum Number of Words You Can Type 1935 Easy
38 Push Dominoes 838 Medium
39 Sum of Digits of String After Convert 1945 Easy
40 Map Sum Pairs 677 Medium
41 Check if All Characters Have Equal Number of Occurrences 1941 Easy
42 Palindrome Partitioning II 132 Hard
43 Minimum Number of Swaps to Make the String Balanced 1963 Medium
44 Check If String Is a Prefix of Array 1961 Easy
45 Add Strings 415 Easy
46 Largest Number After Mutating Substring 1946 Medium
47 Flip String to Monotone Increasing 926 Medium
48 Group Anagrams 49 Medium
49 Word Ladder II 126 Hard
50 Minimum Window Substring 76 Hard
51 Delete Characters to Make Fancy String 1957 Easy
52 Decode Ways 91 Medium
53 Reverse String 344 Easy
54 First Unique Character in a String 387 Easy
55 Valid Anagram 242 Easy
56 Valid Palindrome 125 Easy
57 String to Integer (atoi) 8 Medium
58 Implement strStr() 28 Easy
59 Minimum Time to Type Word Using Special Typewriter 1974 Easy
60 Find Unique Binary String 1980 Medium
61 Complex Number Multiplication 537 Medium
62 Count and Say 38 Medium
63 Longest Common Prefix 14 Easy
64 Verify Preorder Serialization of a Binary Tree 331 Medium
65 Longest Uncommon Subsequence II 522 Medium
66 Find the Kth Largest Integer in the Array 1985 Medium
67 Number of Strings That Appear as Substrings in Word 1967 Easy
68 Orderly Queue 899 Hard
69 Slowest Key 1629 Easy
70 Fizz Buzz 412 Easy
71 Shifting Letters 848 Medium
72 Roman to Integer 13 Easy
73 Valid Parentheses 20 Easy
74 Basic Calculator 224 Hard
75 Maximum Number of Balloons 1189 Easy
76 Reverse Only Letters 917 Easy
77 Number of Unique Good Subsequences 1987 Hard
78 Expression Add Operators 282 Hard
79 Final Value of Variable After Performing Operations 2011 Easy
80 Distinct Subsequences 115 Hard
81 Longest Substring Without Repeating Characters 3 Medium
82 Longest Palindromic Substring 5 Medium
83 Maximum Length of a Concatenated String with Unique Characters 1239 Medium
84 Letter Combinations of a Phone Number 17 Medium
85 Generate Parentheses 22 Medium
86 Break a Palindrome 1328 Medium
87 Unique Email Addresses 929 Easy
88 Longest Common Subsequence 1143 Medium
89 Longest Subsequence Repeated k Times 2014 Hard
90 Implement Trie (Prefix Tree) 208 Medium
91 Number of Pairs of Strings With Concatenation Equal to Target 2023 Medium
92 Maximize the Confusion of an Exam 2024 Medium
93 Longest Repeating Character Replacement 424 Medium
94 Word Search II 212 Hard
95 Remove Colored Pieces if Both Neighbors are the Same Color 2038 Medium
96 Check if Numbers Are Ascending in a Sentence 2042 Easy
97 Excel Sheet Column Number 171 Easy
98 Reverse Words in a String 151 Medium
99 Sort Characters By Frequency 451 Medium
100 Kth Distinct String in an Array 2053 Easy
101 Plates Between Candles 2055 Medium
102 Vowels of All Substrings 2063 Medium
103 Multiply Strings 43 Medium
104 Number of Valid Words for Each Puzzle 1178 Hard
105 Guess the Word 843 Hard
106 Check Whether Two Strings are Almost Equivalent 2068 Easy
107 Decode the Slanted Ciphertext 2075 Medium
108 Iterator for Combination 1286 Medium
109 Expressive Words 809 Medium
110 Text Justification 68 Hard
111 Longest Absolute File Path 388 Medium
112 Decode String 394 Medium
113 Count Vowel Substrings of a String 2062 Easy

String Matching

ID Problem Leetcode ID Difficulty
1 Implement strStr() 28 Easy
2 Subtree of Another Tree 572 Easy

Topological Sort

ID Problem Leetcode ID Difficulty
1 Largest Color Value in a Directed Graph 1857 Hard
2 Count Ways to Build Rooms in an Ant Colony 1916 Hard

Tree

ID Problem Leetcode ID Difficulty
1 Count Ways to Build Rooms in an Ant Colony 1916 Hard
2 Merge BSTs to Create Single BST 1932 Hard
3 Binary Tree Pruning 814 Medium
4 Path Sum II 113 Medium
5 Count Good Nodes in Binary Tree 1448 Medium
6 Maximum Product of Splitted Binary Tree 1339 Medium
7 Two Sum IV - Input is a BST 653 Easy
8 Verify Preorder Serialization of a Binary Tree 331 Medium
9 Maximum Depth of Binary Tree 104 Easy
10 Validate Binary Search Tree 98 Medium
11 Symmetric Tree 101 Easy
12 Binary Tree Level Order Traversal 102 Medium
13 Convert Sorted Array to Binary Search Tree 108 Easy
14 Unique Binary Search Trees II 95 Medium
15 Sum of Distances in Tree 834 Hard
16 Operations on Tree 1993 Medium
17 Binary Tree Zigzag Level Order Traversal 103 Medium
18 Construct Binary Tree from Preorder and Inorder Traversal 105 Medium
19 Kth Smallest Element in a BST 230 Medium
20 Binary Tree Inorder Traversal 94 Easy
21 Subtree of Another Tree 572 Easy
22 Diameter of Binary Tree 543 Easy
23 Construct Binary Search Tree from Preorder Traversal 1008 Medium
24 Path Sum III 437 Medium
25 Cousins in Binary Tree 993 Easy
26 Count Complete Tree Nodes 222 Medium
27 Invert Binary Tree 226 Easy
28 Sum Root to Leaf Numbers 129 Medium
29 Sum of Left Leaves 404 Easy
30 Unique Binary Search Trees 96 Medium
31 Delete Nodes And Return Forest 1110 Medium
32 Find Leaves of Binary Tree 366 Medium
33 Construct Binary Tree from Inorder and Postorder Traversal 106 Medium
34 Delete Node in a BST 450 Medium

Trie

ID Problem Leetcode ID Difficulty
1 Map Sum Pairs 677 Medium
2 Implement Trie (Prefix Tree) 208 Medium
3 Word Search II 212 Hard
4 Number of Valid Words for Each Puzzle 1178 Hard

Two Pointers

ID Problem Leetcode ID Difficulty
1 Swapping Nodes in a Linked List 1721 Medium
2 Merge Strings Alternately 1768 Easy
3 Next Permutation 31 Medium
4 Minimum Adjacent Swaps to Reach the Kth Smallest Number 1850 Medium
5 Maximum Distance Between a Pair of Values 1855 Medium
6 Jump Game VII 1871 Medium
7 Find K Closest Elements 658 Medium
8 Valid Triangle Number 611 Medium
9 Push Dominoes 838 Medium
10 3Sum Closest 16 Medium
11 Trapping Rain Water 42 Hard
12 Minimum Number of Swaps to Make the String Balanced 1963 Medium
13 Remove Duplicates from Sorted Array 26 Easy
14 Rotate Array 189 Medium
15 Intersection of Two Arrays II 350 Easy
16 Intersection of Two Arrays 349 Easy
17 Move Zeroes 283 Easy
18 Reverse String 344 Easy
19 Valid Palindrome 125 Easy
20 Implement strStr() 28 Easy
21 Two Sum IV - Input is a BST 653 Easy
22 Sum of Square Numbers 633 Medium
23 Remove Nth Node From End of List 19 Medium
24 Longest Uncommon Subsequence II 522 Medium
25 Palindrome Linked List 234 Easy
26 Linked List Cycle 141 Easy
27 Merge Sorted Array 88 Easy
28 Reverse Only Letters 917 Easy
29 3Sum 15 Medium
30 Intersection of Two Linked Lists 160 Easy
31 Sort Colors 75 Medium
32 Sort Array By Parity II 922 Easy
33 Partition Array Into Two Arrays to Minimize Sum Difference 2035 Hard
34 Happy Number 202 Easy
35 Reverse Words in a String 151 Medium
36 Expressive Words 809 Medium

Union Find

ID Problem Leetcode ID Difficulty
1 Minimize Hamming Distance After Swap Operations 1722 Medium
2 Count Sub Islands 1905 Medium
3 Making A Large Island 827 Hard
4 Last Day Where You Can Still Cross 1970 Hard
5 GCD Sort of an Array 1998 Hard
6 Number of Islands 200 Medium
7 Path With Minimum Effort 1631 Medium
8 Surrounded Regions 130 Medium
9 Process Restricted Friend Requests 2076 Hard
10 Redundant Connection 684 Medium

Automatically generated using Leet2Git.

About

Integrates your leetcode answers with github

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Python 100.0%