650 curated LeetCode problems organized by topic, from Easy to Hard. Complete this list and you will be ready for any technical interview or competitive programming contest.
| # | Problem | Difficulty | Pattern |
|---|---|---|---|
| 49 | Valid Palindrome | Easy | Two Pointers |
| 50 | Two Sum II | Medium | Two Pointers |
| 51 | 3Sum | Medium | Sort + Two Ptr |
| 52 | Container With Most Water | Medium | Two Pointers |
| 53 | Move Zeroes | Easy | Two Pointers |
| 54 | Merge Sorted Array | Easy | Two Pointers |
| 55 | Reverse String | Easy | Two Pointers |
| 56 | Squares of a Sorted Array | Easy | Two Pointers |
| 57 | Assign Cookies | Easy | Greedy + Sort |
| 58 | Backspace String Compare | Easy | Two Pointers |
| 59 | Intersection of Two Arrays II | Easy | Hash Map |
| 60 | 3Sum Closest | Medium | Sort + Two Ptr |
| 61 | Boats to Save People | Medium | Sort + Two Ptr |
| 62 | Partition Labels | Medium | Greedy |
| 63 | 4Sum | Medium | Sort + Two Ptr |
| 64 | Sort Array By Parity | Easy | Two Pointers |
| 65 | Longest Word in Dict by Deleting | Medium | Two Pointers |
| 66 | Min Diff Between K Scores | Easy | Sort + Window |
| 67 | Two Sum IV - BST | Easy | BST + Set |
| 68 | Subsequences with Sum Condition | Medium | Sort + Two Ptr |
| 69 | Bag of Tokens | Medium | Sort + Two Ptr |
| 70 | String Compression | Medium | Two Pointers |
| 71 | 4Sum II | Medium | Hash Map |
| 72 | Trapping Rain Water | Hard | Two Pointers |
| 73 | Shortest Unsorted Subarray | Medium | Two Pointers |
| # | Problem | Difficulty | Pattern |
|---|---|---|---|
| 124 | Binary Search | Easy | Binary Search |
| 125 | Search Insert Position | Easy | Binary Search |
| 126 | Guess Number Higher or Lower | Easy | Binary Search |
| 127 | First Bad Version | Easy | Binary Search |
| 128 | Valid Perfect Square | Easy | Binary Search |
| 129 | Sqrt(x) | Easy | Binary Search |
| 130 | Arranging Coins | Easy | Binary Search |
| 131 | Search a 2D Matrix | Medium | Binary Search |
| 132 | Koko Eating Bananas | Medium | BS on Answer |
| 133 | Find Min in Rotated Sorted Array | Medium | Binary Search |
| 134 | Search in Rotated Sorted Array | Medium | Binary Search |
| 135 | Time Based Key-Value Store | Medium | Binary Search |
| 136 | Find Peak Element | Medium | Binary Search |
| 137 | First and Last Position | Medium | Binary Search |
| 138 | Search a 2D Matrix II | Medium | Binary Search |
| 139 | Ship Packages in D Days | Medium | BS on Answer |
| 140 | Single Element in Sorted Array | Medium | Binary Search |
| 141 | Spells and Potions | Medium | Sort + BS |
| 142 | Magnetic Force Between Balls | Medium | BS on Answer |
| 143 | Min Days for m Bouquets | Medium | BS on Answer |
| 144 | Peak Index in Mountain Array | Medium | Binary Search |
| 145 | Search in Rotated Array II | Medium | Binary Search |
| 146 | Kth Smallest in Sorted Matrix | Medium | Binary Search |
| 147 | Median of Two Sorted Arrays | Hard | Binary Search |
| 148 | Split Array Largest Sum | Hard | BS on Answer |
| 149 | Find in Mountain Array | Hard | Binary Search |
| 150 | Count Smaller After Self | Hard | Merge Sort / BIT |
| 151 | Count of Range Sum | Hard | Merge Sort / BS |
| # | Problem | Difficulty | Pattern |
|---|---|---|---|
| 152 | Reverse Linked List | Easy | Reversal |
| 153 | Merge Two Sorted Lists | Easy | Two Pointers |
| 154 | Linked List Cycle | Easy | Fast/Slow |
| 155 | Palindrome Linked List | Easy | Fast/Slow + Reverse |
| 156 | Remove Linked List Elements | Easy | Dummy Node |
| 157 | Intersection of Two Lists | Easy | Two Pointers |
| 158 | Middle of the Linked List | Easy | Fast/Slow |
| 159 | Reorder List | Medium | Fast/Slow + Reverse |
| 160 | Remove Nth Node From End | Medium | Two Pointers |
| 161 | Add Two Numbers | Medium | Math + LL |
| 162 | Copy List with Random Pointer | Medium | Hash Map |
| 163 | LRU Cache | Medium | DLL + Hash Map |
| 164 | Swap Nodes in Pairs | Medium | Pointer Manipulation |
| 165 | Sort List | Medium | Merge Sort |
| 166 | Partition List | Medium | Two Lists |
| 167 | Linked List Cycle II | Medium | Fast/Slow |
| 168 | Delete Middle Node | Medium | Fast/Slow |
| 169 | Odd Even Linked List | Medium | Pointer Manipulation |
| 170 | Add Two Numbers II | Medium | Stack + LL |
| 171 | Rotate List | Medium | Cycle + Count |
| 172 | Remove Duplicates II | Medium | Dummy Node |
| 173 | Flatten Multilevel DLL | Medium | DFS / Stack |
| 174 | Merge k Sorted Lists | Hard | Heap / Divide & Conquer |
| 175 | Reverse Nodes in k-Group | Hard | Reversal |
| # | Problem | Difficulty | Pattern |
|---|---|---|---|
| 218 | Implement Trie | Medium | Trie |
| 219 | Add and Search Words | Medium | Trie + DFS |
| 220 | Replace Words | Medium | Trie |
| 221 | Map Sum Pairs | Medium | Trie |
| 222 | Longest Word in Dictionary | Medium | Trie + DFS |
| 223 | Search Suggestions System | Medium | Trie + Sort |
| 224 | Max XOR of Two Numbers | Medium | Bitwise Trie |
| 225 | Word Search II | Hard | Trie + Backtrack |
| 226 | Palindrome Pairs | Hard | Trie |
| 227 | Stream of Characters | Hard | Reverse Trie |
| # | Problem | Difficulty | Pattern |
|---|---|---|---|
| 228 | Kth Largest in Stream | Easy | Min Heap |
| 229 | Last Stone Weight | Easy | Max Heap |
| 230 | Kth Largest in Array | Medium | Quickselect / Heap |
| 231 | K Closest Points | Medium | Heap |
| 232 | Task Scheduler | Medium | Heap + Queue |
| 233 | Design Twitter | Medium | Heap + Design |
| 234 | Reorganize String | Medium | Heap |
| 235 | K Pairs with Smallest Sums | Medium | Heap |
| 236 | Seat Reservation Manager | Medium | Min Heap |
| 237 | Smallest in Infinite Set | Medium | Heap + Set |
| 238 | Max Subsequence Score | Medium | Sort + Heap |
| 239 | Total Cost to Hire K Workers | Medium | Two Heaps |
| 240 | Top K Frequent Words | Medium | Heap |
| 241 | Sort Chars by Frequency | Medium | Heap / Bucket |
| 242 | Ugly Number II | Medium | Heap / DP |
| 243 | IPO | Hard | Two Heaps |
| 244 | Find Median from Data Stream | Hard | Two Heaps |
| 245 | Sliding Window Median | Hard | Two Heaps |
| 246 | Smallest Range from K Lists | Hard | Heap |
| 247 | Trapping Rain Water II | Hard | Heap + BFS |
| 248 | Process Tasks Using Servers | Medium | Two Heaps |
| 249 | Super Ugly Number | Medium | Heap |
| # | Problem | Difficulty | Pattern |
|---|---|---|---|
| 250 | Subsets | Medium | Backtracking |
| 251 | Combination Sum | Medium | Backtracking |
| 252 | Permutations | Medium | Backtracking |
| 253 | Subsets II | Medium | Backtracking + Skip |
| 254 | Combination Sum II | Medium | Backtracking + Skip |
| 255 | Permutations II | Medium | Backtracking + Skip |
| 256 | Word Search | Medium | DFS + Backtrack |
| 257 | Palindrome Partitioning | Medium | Backtracking |
| 258 | Letter Combos of Phone Number | Medium | Backtracking |
| 259 | Combinations | Medium | Backtracking |
| 260 | Generate Parentheses | Medium | Backtracking |
| 261 | Restore IP Addresses | Medium | Backtracking |
| 262 | Find Unique Binary String | Medium | Backtracking |
| 263 | Max Concat String Unique Chars | Medium | Backtracking |
| 264 | Partition to K Equal Subsets | Medium | Backtracking |
| 265 | Matchsticks to Square | Medium | Backtracking |
| 266 | Split String Descending | Medium | Backtracking |
| 267 | N-Queens | Hard | Backtracking |
| 268 | N-Queens II | Hard | Backtracking |
| 269 | Sudoku Solver | Hard | Backtracking |
| 270 | Expression Add Operators | Hard | Backtracking |
| 271 | Word Break II | Hard | Backtracking + Memo |
| # | Problem | Difficulty | Pattern |
|---|---|---|---|
| 272 | Number of Islands | Medium | DFS / BFS |
| 273 | Clone Graph | Medium | DFS + Map |
| 274 | Max Area of Island | Medium | DFS |
| 275 | Pacific Atlantic Water Flow | Medium | DFS |
| 276 | Surrounded Regions | Medium | DFS from Border |
| 277 | Rotting Oranges | Medium | Multi-source BFS |
| 278 | Course Schedule | Medium | Topological Sort |
| 279 | Course Schedule II | Medium | Topological Sort |
| 280 | Redundant Connection | Medium | Union Find |
| 281 | Accounts Merge | Medium | Union Find / DFS |
| 282 | Is Graph Bipartite? | Medium | BFS / DFS Coloring |
| 283 | Shortest Path in Binary Matrix | Medium | BFS |
| 284 | Open the Lock | Medium | BFS |
| 285 | Minimum Height Trees | Medium | Topological (Leaf Trim) |
| 286 | Cheapest Flights K Stops | Medium | Bellman-Ford / BFS |
| 287 | Network Delay Time | Medium | Dijkstra |
| 288 | Min Cost Connect Points | Medium | Prim / Kruskal |
| 289 | Snakes and Ladders | Medium | BFS |
| 290 | Evaluate Division | Medium | DFS / Union Find |
| 291 | Reorder Routes to City Zero | Medium | DFS |
| 292 | Find Eventual Safe States | Medium | DFS Cycle Detection |
| 293 | Shortest Bridge | Medium | DFS + BFS |
| 294 | Detonate Max Bombs | Medium | DFS / BFS |
| 295 | Keys and Rooms | Medium | DFS |
| 296 | Number of Provinces | Medium | DFS / Union Find |
| 297 | Find the Town Judge | Easy | Degree Count |
| 298 | All Paths Source to Target | Medium | DFS / Backtrack |
| 299 | Min Vertices to Reach All | Medium | Indegree |
| 300 | Possible Bipartition | Medium | BFS Coloring |
| 301 | Word Ladder | Hard | BFS |
| 302 | Swim in Rising Water | Hard | Dijkstra / BS + BFS |
| 303 | Alien Dictionary | Hard | Topological Sort |
| 304 | Reconstruct Itinerary | Hard | Euler Path DFS |
| 305 | Word Ladder II | Hard | BFS + Backtrack |
| 306 | Bus Routes | Hard | BFS |
| 307 | Critical Connections | Hard | Tarjan's Bridge |
| 308 | Longest Increasing Path | Hard | DFS + Memo |
| 309 | Making a Large Island | Hard | DFS + Union |
| # | Problem | Difficulty | Pattern |
|---|---|---|---|
| 348 | Unique Paths | Medium | Grid DP |
| 349 | Unique Paths II | Medium | Grid DP |
| 350 | Longest Common Subsequence | Medium | 2D DP |
| 351 | Buy Stock with Fee | Medium | State Machine DP |
| 352 | Minimum Path Sum | Medium | Grid DP |
| 353 | Triangle | Medium | Grid DP |
| 354 | Maximal Square | Medium | 2D DP |
| 355 | Coin Change II | Medium | Unbounded Knapsack |
| 356 | Interleaving String | Medium | 2D DP |
| 357 | Stone Game | Medium | Interval DP |
| 358 | Stone Game II | Medium | Game DP |
| 359 | Last Stone Weight II | Medium | Knapsack |
| 360 | Edit Distance | Medium | 2D DP |
| 361 | Regular Expression Matching | Hard | 2D DP |
| 362 | Wildcard Matching | Hard | 2D DP |
| 363 | Burst Balloons | Hard | Interval DP |
| 364 | Distinct Subsequences | Hard | 2D DP |
| 365 | Stone Game III | Hard | Game DP |
| 366 | Profitable Schemes | Hard | 3D Knapsack |
| 367 | Dungeon Game | Hard | Reverse Grid DP |
| 368 | Cherry Pickup | Hard | 3D DP |
| 369 | Cherry Pickup II | Hard | 3D DP |
| # | Problem | Difficulty | Pattern |
|---|---|---|---|
| 370 | Lemonade Change | Easy | Greedy |
| 371 | Max Units on a Truck | Easy | Sort + Greedy |
| 372 | Array Partition | Easy | Sort + Greedy |
| 373 | Gas Station | Medium | Greedy |
| 374 | Non-overlapping Intervals | Medium | Sort + Greedy |
| 375 | Min Arrows to Burst Balloons | Medium | Sort + Greedy |
| 376 | Queue Reconstruction by Height | Medium | Sort + Greedy |
| 377 | Min Deletions Unique Frequencies | Medium | Greedy |
| 378 | Reduce Array Size to Half | Medium | Greedy |
| 379 | Longest Happy String | Medium | Greedy + Heap |
| 380 | Advantage Shuffle | Medium | Sort + Greedy |
| 381 | Min Rounds All Tasks | Medium | Greedy + Math |
| 382 | Max Ice Cream Bars | Medium | Sort + Greedy |
| 383 | Dota2 Senate | Medium | Greedy + Queue |
| 384 | Two City Scheduling | Medium | Sort + Greedy |
| 385 | Video Stitching | Medium | Greedy |
| 386 | Largest Number | Medium | Custom Sort |
| 387 | Broken Calculator | Medium | Reverse Greedy |
| 388 | Minimize Maximum of Array | Medium | Greedy / BS |
| 389 | Max Length Positive Product | Medium | Greedy / DP |
| 390 | Flower Planting | Medium | Greedy + Graph |
| 391 | Candy | Hard | Two-Pass Greedy |
| 392 | Min Refueling Stops | Hard | Greedy + Heap |
| 393 | Earliest Day Full Bloom | Hard | Sort + Greedy |
| 394 | Min Cost Equal Array | Hard | Weighted Median |
| 395 | Max Events Attended | Medium | Greedy + Heap |
| 396 | Min Ops Array Continuous | Hard | Sort + Sliding Window |
| 397 | Max Points Archery | Medium | Bitmask / Greedy |
| # | Problem | Difficulty | Pattern |
|---|---|---|---|
| 398 | Summary Ranges | Easy | Intervals |
| 399 | Merge Intervals | Medium | Sort + Merge |
| 400 | Insert Interval | Medium | Intervals |
| 401 | Interval List Intersections | Medium | Two Pointers |
| 402 | Remove Covered Intervals | Medium | Sort + Greedy |
| 403 | My Calendar I | Medium | Binary Search / Sort |
| 404 | My Calendar II | Medium | Sweep Line |
| 405 | Car Pooling | Medium | Sweep Line |
| 406 | Meeting Rooms | Easy | Sort + Check |
| 407 | Meeting Rooms II | Medium | Sweep Line / Heap |
| 408 | Min Interval for Queries | Hard | Sort + Heap |
| 409 | Data Stream Disjoint Intervals | Hard | TreeMap / Sort |
| 410 | Employee Free Time | Hard | Merge + Sort |
| 411 | Range Module | Hard | Segment Tree / Sort |
| # | Problem | Difficulty | Pattern |
|---|---|---|---|
| 412 | Plus One | Easy | Math |
| 413 | Happy Number | Easy | Fast/Slow Pointers |
| 414 | Palindrome Number | Easy | Math |
| 415 | Fizz Buzz | Easy | Modulo |
| 416 | Power of Two | Easy | Bit / Math |
| 417 | Power of Three | Easy | Math |
| 418 | Add Binary | Easy | Math |
| 419 | Ugly Number | Easy | Math |
| 420 | Excel Sheet Column Number | Easy | Base Conversion |
| 421 | Excel Sheet Column Title | Easy | Base Conversion |
| 422 | Set Mismatch | Easy | Math / Hash |
| 423 | GCD of Strings | Easy | GCD / Math |
| 424 | Rotate Image | Medium | Matrix Rotation |
| 425 | Count Primes | Medium | Sieve |
| 426 | Factorial Trailing Zeroes | Medium | Math |
| 427 | Multiply Strings | Medium | Math |
| 428 | Detect Squares | Medium | Hash Map + Geometry |
| 429 | Pow(x, n) | Medium | Fast Exponentiation |
| 430 | Reverse Integer | Medium | Math |
| 431 | Robot Bounded in Circle | Medium | Simulation |
| 432 | Random Pick with Weight | Medium | Prefix Sum + BS |
| 433 | Min Moves Equal Elements | Medium | Math |
| 434 | Min Moves Equal Elements II | Medium | Median |
| 435 | Angle Between Clock Hands | Medium | Math |
| 436 | Water and Jug Problem | Medium | GCD / BFS |
| 437 | Max Points on a Line | Hard | Hash Map + Math |
| 438 | Permutation Sequence | Hard | Math (Factorial) |
| 439 | Integer to English Words | Hard | Recursion |
| # | Problem | Difficulty | Pattern |
|---|---|---|---|
| 440 | Single Number | Easy | XOR |
| 441 | Number of 1 Bits | Easy | Bit Count |
| 442 | Counting Bits | Easy | DP + Bits |
| 443 | Reverse Bits | Easy | Bit Manipulation |
| 444 | Hamming Distance | Easy | XOR + Count |
| 445 | Complement of Base 10 | Easy | Bit Flip |
| 446 | Sum of Two Integers | Medium | Bit Manipulation |
| 447 | Single Number II | Medium | Bit Counting |
| 448 | Single Number III | Medium | XOR + Partition |
| 449 | Bitwise AND of Range | Medium | Bit Shift |
| 450 | Find the Duplicate Number | Medium | Fast/Slow / Bits |
| 451 | UTF-8 Validation | Medium | Bit Masking |
| 452 | Min Flips a OR b = c | Medium | Bit Manipulation |
| 453 | XOR Queries of Subarray | Medium | Prefix XOR |
| 454 | Total Hamming Distance | Medium | Bit Count |
| 455 | Gray Code | Medium | Bit Manipulation |
| 456 | Divide Two Integers | Medium | Bit Shift |
| 457 | Decode XORed Permutation | Medium | XOR |
| # | Problem | Difficulty | Pattern |
|---|---|---|---|
| 458 | Longest Consecutive Sequence | Medium | Union Find / Set |
| 459 | Connected Components | Medium | Union Find |
| 460 | Graph Valid Tree | Medium | Union Find |
| 461 | Most Stones Removed | Medium | Union Find |
| 462 | Satisfiability of Equality | Medium | Union Find |
| 463 | Network Connected | Medium | Union Find |
| 464 | Smallest String with Swaps | Medium | Union Find + Sort |
| 465 | Similar String Groups | Hard | Union Find |
| 466 | Number of Islands II | Hard | Union Find |
| 467 | Couples Holding Hands | Hard | Union Find / Greedy |
| 468 | Minimize Malware Spread | Hard | Union Find |
| 469 | Regions Cut By Slashes | Medium | Union Find |
| # | Problem | Difficulty | Pattern |
|---|---|---|---|
| 470 | Design HashMap | Easy | Hash Map |
| 471 | Design HashSet | Easy | Hash Set |
| 472 | Min Stack | Medium | Stack Design |
| 473 | LRU Cache | Medium | DLL + Map |
| 474 | Design Browser History | Medium | Stack / DLL |
| 475 | Implement Trie | Medium | Trie |
| 476 | Design Circular Queue | Medium | Array / LL |
| 477 | Design Underground System | Medium | Hash Map |
| 478 | Snapshot Array | Medium | Binary Search |
| 479 | Online Stock Span | Medium | Monotonic Stack |
| 480 | LFU Cache | Hard | DLL + Map |
| 481 | Find Median from Stream | Hard | Two Heaps |
| 482 | Autocomplete System | Hard | Trie + Sort |
| 483 | All O(1) Data Structure | Hard | DLL + Map |
| # | Problem | Difficulty | Pattern |
|---|---|---|---|
| 514 | Merge Sorted Array | Easy | Two Pointers |
| 515 | Valid Anagram | Easy | Sort / Hash |
| 516 | Sort an Array | Medium | Merge Sort |
| 517 | Sort List | Medium | Merge Sort |
| 518 | Insertion Sort List | Medium | Insertion Sort |
| 519 | Kth Largest Element | Medium | Quickselect |
| 520 | Wiggle Sort II | Medium | Sort + Place |
| 521 | Largest Number | Medium | Custom Comparator |
| 522 | Top K Frequent | Medium | Bucket Sort |
| 523 | Sort Chars by Frequency | Medium | Bucket Sort |
| 524 | Relative Sort Array | Easy | Counting Sort |
| 525 | Maximum Gap | Medium | Radix / Bucket Sort |
| 526 | Sort Colors | Medium | Dutch Flag |
| 527 | Pancake Sorting | Medium | Simulation |
| 528 | Count Smaller After Self | Hard | Merge Sort |
| # | Problem | Difficulty | Pattern |
|---|---|---|---|
| 529 | Running Sum of 1D Array | Easy | Prefix Sum |
| 530 | Find Pivot Index | Easy | Prefix Sum |
| 531 | Range Sum Query Immutable | Easy | Prefix Sum |
| 532 | Subarray Sum Equals K | Medium | Prefix Sum + Map |
| 533 | Contiguous Array | Medium | Prefix Sum + Map |
| 534 | Product Except Self | Medium | Prefix / Suffix |
| 535 | Random Pick with Weight | Medium | Prefix Sum + BS |
| 536 | Range Sum Query 2D | Medium | 2D Prefix Sum |
| 537 | Min Penalty for Shop | Medium | Prefix Sum |
| 538 | Path Sum III | Medium | Prefix Sum + DFS |
| 539 | XOR Queries | Medium | Prefix XOR |
| 540 | Ways to Split Array | Medium | Prefix Sum |
| 541 | Max Sum Almost Unique Subarray | Medium | Window + Prefix |
| 542 | Count Subarrays Fixed Bounds | Hard | Sliding Window |
| # | Problem | Difficulty | Pattern |
|---|---|---|---|
| 543 | Reshape the Matrix | Easy | Matrix |
| 544 | Transpose Matrix | Easy | Matrix |
| 545 | Matrix Diagonal Sum | Easy | Matrix |
| 546 | Rotate Image | Medium | Matrix Rotation |
| 547 | Spiral Matrix | Medium | Simulation |
| 548 | Set Matrix Zeroes | Medium | In-Place |
| 549 | Where Will Ball Fall | Medium | Simulation |
| 550 | 01 Matrix | Medium | BFS |
| 551 | Diagonal Traverse | Medium | Simulation |
| 552 | Toeplitz Matrix | Easy | Matrix |
| 553 | Number of Islands | Medium | DFS / BFS |
| 554 | Surrounded Regions | Medium | DFS from Border |
| 555 | Word Search | Medium | DFS + Backtrack |
| 556 | Maximal Square | Medium | DP |
| 557 | Shortest Path Binary Matrix | Medium | BFS |
| # | Problem | Difficulty | Pattern |
|---|---|---|---|
| 558 | Power of Two | Easy | Recursion |
| 559 | Power of Four | Easy | Recursion / Math |
| 560 | Reverse Linked List | Easy | Recursion |
| 561 | Swap Nodes in Pairs | Medium | Recursion |
| 562 | Merge Two Sorted Lists | Easy | Recursion |
| 563 | Pow(x, n) | Medium | Recursion (D&C) |
| 564 | Generate Parentheses | Medium | Recursion |
| 565 | Different Ways to Add Parens | Medium | Divide & Conquer |
| 566 | Kth Symbol in Grammar | Medium | Recursion |
| 567 | Predict the Winner | Medium | Game Recursion |
| 568 | Sort List | Medium | Merge Sort Recursion |
| 569 | Strobogrammatic Number II | Medium | Recursion |
These are the problems that test everything you've learned. Complete these and you're elite.
650 problems is a lot. But if you do 3 problems a day, you'll finish in about 7 months. That's 7 months to be better than 99% of developers at problem-solving. Start today. One problem at a time.
Need the foundations first? Start with the DSA Foundations page.