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 help you do that. This platform empowers programmers to improve 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 2000. Every problem on LeetCode is worth trying, but for the very first time, you couldn’t solve all of the problems in one or two days, it takes time, patience, effort, or even willpower. Choosing the right first ones is a good start, so in this article, I want to list the 150 most popular problems on LeetCode from easy to advanced which is based on the highest number of votes.
Also read:
Top 50 Easy Coding Problems
- Two Sum
- Maximum Subarray
- Valid Parentheses
- Best Time to Buy and Sell Stock
- House Robber
- Reverse Linked List
- Single Number
- Merge Two Sorted Lists
- Climbing Stairs
- Symmetric Tree
- Intersection of Two Linked Lists
- Reverse Integer
- Move Zeroes
- Path Sum III
- Min Stack
- Inverse Binary Tree
- Merge Two Binary Tree
- Majority Element
- Palindrome Linked List
- Find All Numbers Disappeared in an Array
- Linked List Cycle
- Remove Duplicates from Sorted Array
- Diameter of Binary Tree
- Shortest Unsorted Continuous Subarray
- Rotate Array
- Longest Common Prefix
- Palindrome Number
- Maximum Depth of Binary Tree
- Jewels and Stones
- Search Insert Position
- Balanced Binary Tree
- Convert Sorted Array to Binary Search Tree
- Subtree of Another Tree
- Roman to Integer
- Convert BST to Greater Tree
- Same Tree
- Merge Sorted Array
- Hamming Distance
- Lowest Common Ancestor of a Binary Search Tree
- Best Time to Buy and Sell Stock II
- Count Primes
- Min Cost Climbing Stairs
- Trim a Binary Search Tree
- Non-decreasing Array
- Island Perimeter
- First Unique Character in a String
- Add Binary
- Path Sum
- Longest Univalue Path
- Happy Number
Top 50 Intermediate Coding Problems
- Longest Substring Without Repeating Characters
- Add Two Numbers
- 3Sum
- Longest Palindromic Substring
- Container With Most Water
- Generate Parentheses
- Number of Islands
- Search in Rotated Sorted Array
- Longest Increasing Subsequence
- Find the Duplicate Number
- Product of Array Except Self
- Word Break
- Merge Intervals
- Letter Combinations of a Phone Number
- Subarray Sum Equals K
- Maximum Product Subarray
- Permutations
- Combination Sum
- Validate Binary Search Tree
- Jump Game
- Kth Largest Element in an Array
- Subsets
- Lowest Common Ancestor of a Binary Tree
- Coin Change
- Course Schedule
- Word Search
- Next Permutation
- Remove Nth Node From End of List
- Unique Binary Search Trees
- Construct Binary Tree from Preorder and Inorder Traversal
- Group Anagrams
- Find First and Last Position of Element in Sorted Array
- Sort Colors
- Binary Tree Inorder Traversal
- Copy List with Random Pointer
- Task Scheduler
- Decode String
- Search a 2D Matrix II
- Unique Paths
- Rotate Image
- Word Ladder
- Top K Frequent Elements
- Implement Trie (Prefix Tree)
- Binary Tree Level Order Traversal
- Find All Anagrams in a String
- Flatten Binary Tree to Linked List
- Queue Reconstruction by Height
- Meeting Rooms II
- Sort List
- House Robber III
Top 50 Hard Coding Problems
- Median of Two Sorted Arrays
- Trapping Rain Water
- Regular Expression Matching
- Merge k Sorted Lists
- Minimum Window Substring
- Edit Distance
- Largest Rectangle in Histogram
- Longest Valid Parentheses
- Longest Consecutive Sequence
- First Missing Positive
- Sliding Window Maximum
- Binary Tree Maximum Path Sum
- Serialize and Deserialize Binary Tree
- Maximal Rectangle
- Remove Invalid Parentheses
- Burst Balloons
- Find Median from Data Stream
- Jump Game II
- Word Search II
- Count of Smaller Numbers After Self
- Reverse Nodes in k-Group
- The Skyline Problem
- Best Time to Buy and Sell Stock III
- Wildcard Matching
- Longest Increasing Path in a Matrix
- Word Ladder II
- Word Break II
- N-Queens
- Sudoku Solver
- Binary Tree Postorder Traversal
- Alien Dictionary
- Split Array Largest Sum
- Insert Interval
- Recover Binary Search Tree
- Basic Calculator
- Best Time to Buy and Sell Stock IV
- Interleaving String
- Palindrome Pairs
- LFU Cache
- Remove Duplicate Letters
- Trapping Rain Water
- Dungeon Game
- Expression Add Operators
- Distinct Subsequences
- Smallest Range Covering Elements from K Lists
- Shortest Palindrome
- Palindrome Partitioning II
- Russian Doll Envelopes
- Longest Substring with at most K Distinct Characters
- 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!