Top 150 best practice LeetCode’s problems sorted by difficulties4 min read

If you want to sharpen your problem-solving and coding skills, indeed Leetcode is one of the best places that helps you do that. This platform helps programmers solidify their skills through a number of coding challenges from easy to advanced. In fact, when you visit LeetCode, there are a tremendous number of problems which up to over 1000. Every problem on LeetCode is worth to try, but for the very first time, you couldn’t solve all of the problems in one or two days, it takes time, patient, effort or even willpower. Choosing the right first ones is a good start, so in this article, I want to list 150 most outstanding problems on LeetCode from easy to advanced which based on the highest number of votes.

Also read:

Top 50 Easy Coding Problems

  1. Two Sum
  2. Maximum Subarray
  3. Valid Parentheses
  4. Best Time to Buy and Sell Stock
  5. House Robber
  6. Reverse Linked List
  7. Single Number
  8. Merge Two Sorted Lists
  9. Climbing Stairs
  10. Symmetric Tree
  11. Intersection of Two Linked Lists
  12. Reverse Integer
  13. Move Zeroes
  14. Path Sum III
  15. Min Stack
  16. Inverse Binary Tree
  17. Merge Two Binary Tree
  18. Majority Element
  19. Palindrome Linked List
  20. Find All Numbers Disappeared in an Array
  21. Linked List Cycle
  22. Remove Duplicates from Sorted Array
  23. Diameter of Binary Tree
  24. Shortest Unsorted Continuous Subarray
  25. Rotate Array
  26. Longest Common Prefix
  27. Palindrome Number
  28. Maximum Depth of Binary Tree
  29. Jewels and Stones
  30. Search Insert Position
  31. Balanced Binary Tree
  32. Convert Sorted Array to Binary Search Tree
  33. Subtree of Another Tree
  34. Roman to Integer
  35. Convert BST to Greater Tree
  36. Same Tree
  37. Merge Sorted Array
  38. Hamming Distance
  39. Lowest Common Ancestor of a Binary Search Tree
  40. Best Time to Buy and Sell Stock II  
  41. Count Primes
  42. Min Cost Climbing Stairs
  43. Trim a Binary Search Tree 
  44. Non-decreasing Array
  45. Island Perimeter
  46. First Unique Character in a String
  47. Add Binary
  48. Path Sum
  49. Longest Univalue Path
  50. Happy Number  

Top 50 Intermediate Coding Problems

  1. Longest Substring Without Repeating Characters
  2. Add Two Numbers
  3. 3Sum  
  4. Longest Palindromic Substring
  5. Container With Most Water
  6. Generate Parentheses
  7. Number of Islands
  8. Search in Rotated Sorted Array
  9. Longest Increasing Subsequence 
  10. Find the Duplicate Number
  11. Product of Array Except Self
  12. Word Break 
  13. Merge Intervals 
  14. Letter Combinations of a Phone Number
  15. Subarray Sum Equals K    
  16. Maximum Product Subarray
  17. Permutations 
  18. Combination Sum 
  19. Validate Binary Search Tree
  20. Jump Game
  21. Kth Largest Element in an Array
  22. Subsets
  23. Lowest Common Ancestor of a Binary Tree
  24. Coin Change
  25. Course Schedule 
  26. Word Search
  27. Next Permutation 
  28. Remove Nth Node From End of List
  29. Unique Binary Search Trees
  30. Construct Binary Tree from Preorder and Inorder Traversal
  31. Group Anagrams
  32. Find First and Last Position of Element in Sorted Array  
  33. Sort Colors
  34. Binary Tree Inorder Traversal
  35. Copy List with Random Pointer
  36. Task Scheduler 
  37. Decode String
  38. Search a 2D Matrix II
  39. Unique Paths
  40. Rotate Image 
  41. Word Ladder
  42. Top K Frequent Elements
  43. Implement Trie (Prefix Tree)
  44. Binary Tree Level Order Traversal
  45. Find All Anagrams in a String    
  46. Flatten Binary Tree to Linked List
  47. Queue Reconstruction by Height 
  48. Meeting Rooms II  
  49. Sort List
  50. House Robber III

Top 50 Hard Coding Problems

  1. Median of Two Sorted Arrays
  2. Trapping Rain Water 
  3. Regular Expression Matching
  4. Merge k Sorted Lists
  5. Minimum Window Substring
  6. Edit Distance
  7. Largest Rectangle in Histogram
  8. Longest Valid Parentheses
  9. Longest Consecutive Sequence
  10. First Missing Positive
  11. Sliding Window Maximum
  12. Binary Tree Maximum Path Sum
  13. Serialize and Deserialize Binary Tree
  14. Maximal Rectangle 
  15. Remove Invalid Parentheses
  16. Burst Balloons
  17. Find Median from Data Stream
  18. Jump Game II
  19. Word Search II
  20. Count of Smaller Numbers After Self
  21. Reverse Nodes in k-Group
  22. The Skyline Problem 
  23. Best Time to Buy and Sell Stock III
  24. Wildcard Matching 
  25. Longest Increasing Path in a Matrix   
  26. Word Ladder II
  27. Word Break II
  28. N-Queens    
  29. Sudoku Solver
  30. Binary Tree Postorder Traversal
  31. Alien Dictionary 
  32. Split Array Largest Sum
  33. Insert Interval
  34. Recover Binary Search Tree
  35. Basic Calculator     
  36. Best Time to Buy and Sell Stock IV
  37. Interleaving String
  38. Palindrome Pairs 
  39. LFU Cache    
  40. Remove Duplicate Letters
  41. Trapping Rain Water
  42. Dungeon Game
  43. Expression Add Operators
  44. Distinct Subsequences 
  45. Smallest Range Covering Elements from K Lists   
  46. Shortest Palindrome
  47. Palindrome Partitioning II
  48. Russian Doll Envelopes   
  49. Longest Substring with at most K Distinct Characters
  50. Robot Room Cleaner

Above I have listed 150 best practice LeetCode’s coding questions from easy to hard based on the number of upvotes per each question, from highest upvote numbers and gradually decrease by. And if needed, this is the repository that has solutions for most of the problems above: https://github.com/haoel/leetcode. Hope you have time to practice with some of them. Happy coding!

Previous Article
Next Article

Subscribe to my newsletter to get weekly updates

Categories

Archives