Convert Figma logo to code with AI

haoel logoleetcode

LeetCode Problems' Solutions

17,575
4,910
17,575
47

Top Related Projects

Demonstrate all the questions on LeetCode in the form of animation.(用动画的形式呈现解LeetCode题目的思路)

54,606

LeetCode Solutions: A Record of My Problem Solving Journey.( leetcode题解,记录自己的leetcode解题之路。)

刷算法全靠套路,认准 labuladong 就够了!English version supported! Crack LeetCode, not only how, but also why.

✅ Solutions to LeetCode by Go, 100% test coverage, runtime beats 100% / LeetCode 题解

Everything you need to know to get the job.

🏋️ Python / Modern C++ Solutions of All 3283 LeetCode Problems (Weekly Update)

Quick Overview

The haoel/leetcode repository is a collection of LeetCode problem solutions implemented in various programming languages, primarily C++. It serves as a resource for developers preparing for coding interviews or looking to improve their problem-solving skills. The repository includes solutions to a wide range of algorithmic and data structure problems.

Pros

  • Comprehensive collection of LeetCode problem solutions
  • Solutions are implemented in multiple programming languages, with a focus on C++
  • Well-organized structure with problems categorized by difficulty and topic
  • Includes explanations and comments for many solutions, aiding in understanding

Cons

  • Some solutions may not be optimized or represent the best approach
  • Not all problems have solutions in every programming language
  • Limited community engagement and contributions
  • May not always be up-to-date with the latest LeetCode problems

Code Examples

Here are a few examples of problem solutions from the repository:

  1. Two Sum problem (Easy):
class Solution {
public:
    vector<int> twoSum(vector<int>& nums, int target) {
        unordered_map<int, int> map;
        for (int i = 0; i < nums.size(); i++) {
            int complement = target - nums[i];
            if (map.find(complement) != map.end()) {
                return {map[complement], i};
            }
            map[nums[i]] = i;
        }
        return {};
    }
};
  1. Reverse Linked List (Easy):
class Solution {
public:
    ListNode* reverseList(ListNode* head) {
        ListNode* prev = nullptr;
        ListNode* curr = head;
        while (curr != nullptr) {
            ListNode* nextTemp = curr->next;
            curr->next = prev;
            prev = curr;
            curr = nextTemp;
        }
        return prev;
    }
};
  1. Valid Parentheses (Easy):
class Solution {
public:
    bool isValid(string s) {
        stack<char> st;
        for (char c : s) {
            if (c == '(' || c == '{' || c == '[') {
                st.push(c);
            } else {
                if (st.empty()) return false;
                if (c == ')' && st.top() != '(') return false;
                if (c == '}' && st.top() != '{') return false;
                if (c == ']' && st.top() != '[') return false;
                st.pop();
            }
        }
        return st.empty();
    }
};

Getting Started

To use this repository:

  1. Clone the repository:
    git clone https://github.com/haoel/leetcode.git
    
  2. Navigate to the problem you're interested in.
  3. Choose the programming language implementation you prefer.
  4. Study the solution and try to understand the approach.
  5. Implement and test the solution on LeetCode to verify its correctness.

Competitor Comparisons

Demonstrate all the questions on LeetCode in the form of animation.(用动画的形式呈现解LeetCode题目的思路)

Pros of LeetCodeAnimation

  • Provides animated visualizations of algorithms, making them easier to understand
  • Covers a wide range of LeetCode problems with detailed explanations
  • Regularly updated with new content and improvements

Cons of LeetCodeAnimation

  • Primarily focuses on Java solutions, limiting language diversity
  • May not cover as many problems as leetcode repository
  • Animations can be time-consuming to create, potentially slowing down updates

Code Comparison

LeetCodeAnimation (Java):

public ListNode reverseList(ListNode head) {
    ListNode prev = null;
    ListNode curr = head;
    while (curr != null) {
        ListNode nextTemp = curr.next;
        curr.next = prev;
        prev = curr;
        curr = nextTemp;
    }
    return prev;
}

leetcode (C++):

ListNode* reverseList(ListNode* head) {
    ListNode* prev = nullptr;
    ListNode* curr = head;
    while (curr != nullptr) {
        ListNode* nextTemp = curr->next;
        curr->next = prev;
        prev = curr;
        curr = nextTemp;
    }
    return prev;
}

Both repositories provide solutions to the "Reverse Linked List" problem, but LeetCodeAnimation offers an animated explanation alongside the code, while leetcode focuses on concise implementations in multiple languages.

54,606

LeetCode Solutions: A Record of My Problem Solving Journey.( leetcode题解,记录自己的leetcode解题之路。)

Pros of leetcode (azl397985856)

  • More comprehensive coverage with 1000+ problems solved
  • Includes detailed explanations and multiple solution approaches
  • Actively maintained with frequent updates

Cons of leetcode (azl397985856)

  • Primarily in Chinese, which may be a barrier for non-Chinese speakers
  • Less organized structure compared to haoel's repository
  • Some solutions may be overly complex for beginners

Code Comparison

leetcode (haoel):

class Solution {
public:
    vector<int> twoSum(vector<int>& nums, int target) {
        unordered_map<int, int> m;
        for (int i = 0; i < nums.size(); i++) {
            if (m.find(target - nums[i]) != m.end()) {
                return {m[target - nums[i]], i};
            }
            m[nums[i]] = i;
        }
        return {};
    }
};

leetcode (azl397985856):

var twoSum = function(nums, target) {
    const map = new Map();
    for(let i = 0; i < nums.length; i++) {
        const complement = target - nums[i];
        if(map.has(complement)) {
            return [map.get(complement), i];
        }
        map.set(nums[i], i);
    }
};

Both repositories provide similar solutions, but in different programming languages. The azl397985856 repository often includes multiple approaches and more detailed explanations for each problem.

刷算法全靠套路,认准 labuladong 就够了!English version supported! Crack LeetCode, not only how, but also why.

Pros of fucking-algorithm

  • Provides in-depth explanations and strategies for solving algorithmic problems
  • Offers a structured learning approach with categorized topics
  • Includes visualizations and diagrams to aid understanding

Cons of fucking-algorithm

  • Limited to specific algorithms and problem-solving techniques
  • May not cover as wide a range of LeetCode problems as leetcode
  • Content is primarily in Chinese, which may be a barrier for non-Chinese speakers

Code Comparison

leetcode:

class Solution {
public:
    vector<int> twoSum(vector<int>& nums, int target) {
        unordered_map<int, int> map;
        for (int i = 0; i < nums.size(); i++) {
            int complement = target - nums[i];
            if (map.find(complement) != map.end()) {
                return {map[complement], i};
            }
            map[nums[i]] = i;
        }
        return {};
    }
};

fucking-algorithm:

def twoSum(nums: List[int], target: int) -> List[int]:
    need = {}
    for i, num in enumerate(nums):
        if num in need:
            return [need[num], i]
        need[target - num] = i
    return []

The code comparison shows different implementations of the "Two Sum" problem. leetcode uses C++ with an unordered_map, while fucking-algorithm uses Python with a dictionary. Both solutions have similar time complexity, but the Python implementation is more concise.

✅ Solutions to LeetCode by Go, 100% test coverage, runtime beats 100% / LeetCode 题解

Pros of LeetCode-Go

  • Written in Go, offering solutions for those focusing on this language
  • More comprehensive, with solutions for 700+ problems
  • Includes detailed explanations and time/space complexity analyses

Cons of LeetCode-Go

  • Limited to a single programming language (Go)
  • May be overwhelming for beginners due to its extensive coverage

Code Comparison

LeetCode-Go (Go):

func twoSum(nums []int, target int) []int {
    m := make(map[int]int)
    for i, num := range nums {
        if j, ok := m[target-num]; ok {
            return []int{j, i}
        }
        m[num] = i
    }
    return nil
}

leetcode (C++):

vector<int> twoSum(vector<int>& nums, int target) {
    unordered_map<int, int> m;
    for (int i = 0; i < nums.size(); i++) {
        if (m.find(target - nums[i]) != m.end()) {
            return {m[target - nums[i]], i};
        }
        m[nums[i]] = i;
    }
    return {};
}

Both implementations solve the "Two Sum" problem efficiently using hash maps, but LeetCode-Go uses Go-specific syntax and features, while leetcode uses C++.

Everything you need to know to get the job.

Pros of interviews

  • More comprehensive coverage of topics beyond just LeetCode problems
  • Includes system design and behavioral interview preparation materials
  • Provides additional resources like books, articles, and interview experiences

Cons of interviews

  • Less focused on specific LeetCode problem solutions
  • May not be as frequently updated as leetcode repository
  • Organization can be more complex, potentially making it harder to find specific problems

Code comparison

interviews:

public ListNode reverseList(ListNode head) {
    ListNode prev = null;
    while (head != null) {
        ListNode next = head.next;
        head.next = prev;
        prev = head;
        head = next;
    }
    return prev;
}

leetcode:

ListNode* reverseList(ListNode* head) {
    ListNode* prev = nullptr;
    while (head) {
        ListNode* next = head->next;
        head->next = prev;
        prev = head;
        head = next;
    }
    return prev;
}

Both repositories provide similar implementations for reversing a linked list, with interviews using Java and leetcode using C++. The logic and structure are nearly identical, demonstrating the consistency in problem-solving approaches across different programming languages.

🏋️ Python / Modern C++ Solutions of All 3283 LeetCode Problems (Weekly Update)

Pros of LeetCode-Solutions

  • More comprehensive coverage with solutions in multiple programming languages
  • Regularly updated with new problems and solutions
  • Includes detailed explanations and time/space complexity analysis for each solution

Cons of LeetCode-Solutions

  • Less organized structure compared to leetcode's categorization by difficulty
  • May be overwhelming for beginners due to the sheer volume of solutions
  • Some solutions lack detailed comments or explanations within the code

Code Comparison

LeetCode-Solutions (Python):

class Solution:
    def twoSum(self, nums: List[int], target: int) -> List[int]:
        num_map = {}
        for i, num in enumerate(nums):
            if target - num in num_map:
                return [num_map[target - num], i]
            num_map[num] = i
        return []

leetcode (C++):

class Solution {
public:
    vector<int> twoSum(vector<int>& nums, int target) {
        unordered_map<int, int> m;
        for (int i = 0; i < nums.size(); ++i) {
            if (m.find(target - nums[i]) != m.end()) {
                return {m[target - nums[i]], i};
            }
            m[nums[i]] = i;
        }
        return {};
    }
};

Both repositories provide solutions to LeetCode problems, but LeetCode-Solutions offers a wider range of languages and more frequent updates. However, leetcode's organization may be more beginner-friendly. The code comparison shows similar approaches to the "Two Sum" problem, with LeetCode-Solutions using Python and leetcode using C++.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

LeetCode

LeetCode Algorithm

(Notes: "🔒" means you need to buy a book from Leetcode)

#TitleSolutionDifficulty
1946Largest Number After Mutating SubstringC++, JavaMedium
1945Sum of Digits of String After ConvertC++Easy
1935Maximum Number of Words You Can TypeC++Easy
1884Egg Drop With 2 Eggs and N FloorsC++Medium
1882Process Tasks Using ServersC++Medium
1881Maximum Value after InsertionC++Medium
1880Check if Word Equals Summation of Two WordsC++Easy
1877Minimize Maximum Pair Sum in ArrayC++Medium
1876Substrings of Size Three with Distinct CharactersC++Easy
1871Jump Game VIIC++Medium
1870Minimum Speed to Arrive on TimeC++Medium
1869Longer Contiguous Segments of Ones than ZerosC++Easy
1862Sum of Floored PairsC++Hard
1861Rotating the BoxC++Medium
1860Incremental Memory LeakC++Medium
1859Sorting the SentenceC++Easy
1857Largest Color Value in a Directed GraphC++Hard
1856Maximum Subarray Min-ProductC++Medium
1855Maximum Distance Between a Pair of ValuesC++Medium
1854Maximum Population YearC++Easy
1851Minimum Interval to Include Each QueryC++Hard
1850Minimum Adjacent Swaps to Reach the Kth Smallest NumberC++Medium
1849Splitting a String Into Descending Consecutive ValuesC++Medium
1848Minimum Distance to the Target ElementC++Easy
1847Closest RoomC++Hard
1846Maximum Element After Decreasing and RearrangingC++Medium
1845Seat Reservation ManagerC++Medium
1844Replace All Digits with CharactersC++Easy
1840Maximum Building HeightC++Hard
1839Longest Substring Of All Vowels in OrderC++Medium
1838Frequency of the Most Frequent ElementC++Medium
1837Sum of Digits in Base KC++Easy
1835Find XOR Sum of All Pairs Bitwise ANDC++Hard
1834Single-Threaded CPUC++Medium
1833Maximum Ice Cream BarsC++Medium
1832Check if the Sentence Is PangramC++Easy
1829Maximum XOR for Each QueryC++Medium
1828Queries on Number of Points Inside a CircleC++Medium
1827Minimum Operations to Make the Array IncreasingC++Easy
1825Finding MK AverageC++Hard
1824Minimum Sideway JumpsC++Medium
1823Find the Winner of the Circular GameC++Medium
1822Sign of the Product of an ArrayC++Easy
1819Number of Different Subsequences GCDsC++Hard
1818Minimum Absolute Sum DifferenceC++Medium
1817Finding the Users Active MinutesC++Medium
1816Truncate SentenceC++Easy
1815Maximum Number of Groups Getting Fresh DonutsC++Hard
1814Count Nice Pairs in an ArrayC++Medium
1813Sentence Similarity IIIC++Medium
1812Determine Color of a Chessboard SquareC++Easy
1808Maximize Number of Nice DivisorsC++Hard
1807Evaluate the Bracket Pairs of a StringC++Medium
1806Minimum Number of Operations to Reinitialize a PermutationC++Medium
1805Number of Different Integers in a StringC++Easy
1803Count Pairs With XOR in a RangeC++Hard
1802Maximum Value at a Given Index in a Bounded ArrayC++Medium
1801Number of Orders in the BacklogC++Medium
1800Maximum Ascending Subarray SumC++Easy
1799Maximize Score After N OperationsC++Hard
1798Maximum Number of Consecutive Values You Can MakeC++Medium
1797Design Authentication ManagerC++Medium
1796Second Largest Digit in a StringC++Easy
1793Maximum Score of a Good SubarrayC++Hard
1792Maximum Average Pass RatioC++Medium
1791Find Center of Star GraphC++Medium
1790Check if One String Swap Can Make Strings EqualC++Easy
1787Make the XOR of All Segments Equal to ZeroC++Hard
1786Number of Restricted Paths From First to Last NodeC++Medium
1785Minimum Elements to Add to Form a Given SumC++Medium
1784Check if Binary String Has at Most One Segment of OnesC++Easy
1782Count Pairs Of NodesC++Hard
1781Sum of Beauty of All SubstringsC++Medium
1780Check if Number is a Sum of Powers of ThreeC++Medium
1779Find Nearest Point That Has the Same X or Y CoordinateC++Easy
1775Equal Sum Arrays With Minimum Number of OperationsC++Medium
1774Closest Dessert CostC++Medium
1773Count Items Matching a RuleC++Easy
1771Maximize Palindrome Length From SubsequencesC++Hard
1770Maximum Score from Performing Multiplication OperationsC++Medium
1769Minimum Number of Operations to Move All Balls to Each BoxC++Medium
1768Merge Strings AlternatelyC++Easy
1766Tree of CoprimesC++Hard
1765Map of Highest PeakC++Medium
1764Form Array by Concatenating Subarrays of Another ArrayC++Medium
1763Longest Nice SubstringC++Easy
1761Minimum Degree of a Connected Trio in a GraphC++Hard
1760Minimum Limit of Balls in a BagC++Medium
1759Count Number of Homogenous SubstringsC++Medium
1758Minimum Changes To Make Alternating Binary StringC++Easy
1755Closest Subsequence SumC++Hard
1754Largest Merge Of Two StringsC++Medium
1753Maximum Score From Removing StonesC++Medium
1752Check if Array Is Sorted and RotatedC++Easy
1751Maximum Number of Events That Can Be Attended IIC++Hard
1750Minimum Length of String After Deleting Similar EndsC++Medium
1749Maximum Absolute Sum of Any SubarrayC++Medium
1748Sum of Unique ElementsC++Easy
1743Restore the Array From Adjacent PairsC++Medium
1742Maximum Number of Balls in a BoxC++Easy
1739Building BoxesC++Hard
1738Find Kth Largest XOR Coordinate ValueC++Medium
1736Latest Time by Replacing Hidden DigitsC++Easy
1734Decode XORed PermutationC++Medium
1733Minimum Number of People to TeachC++Medium
1732Find the Highest AltitudeC++Easy
1727Largest Submatrix With RearrangementsC++Medium
1726Tuple with Same ProductC++Medium
1725Number Of Rectangles That Can Form The Largest SquareC++Easy
1718Construct the Lexicographically Largest Valid SequenceC++Medium
1717Maximum Score From Removing SubstringsC++Medium
1716Calculate Money in Leetcode BankC++Easy
1712Ways to Split Array Into Three SubarraysC++Medium
1711Count Good MealsC++Medium
1710Maximum Units on a TruckC++Easy
1700Number of Students Unable to Eat LunchC++Easy
1695Maximum Erasure ValueC++Medium
1694Reformat Phone NumberC++Easy
1625Lexicographically Smallest String After Applying OperationsC++Medium
1624Largest Substring Between Two Equal CharactersC++Easy
1605Find Valid Matrix Given Row and Column SumsC++Medium
1573Number of Ways to Split a StringC++Medium
1556Thousand SeparatorC++Easy
1551Minimum Operations to Make Array EqualC++Medium
1550Three Consecutive OddsC++Easy
1541Minimum Insertions to Balance a Parentheses StringC++Medium
1535Find the Winner of an Array GameC++Medium
1529Bulb Switcher IVC++Medium
1528Shuffle StringC++Easy
1525Number of Good Ways to Split a StringC++Medium
1524Number of Sub-arrays With Odd SumC++Medium
1523Count Odd Numbers in an Interval RangeC++Easy
1513Number of Substrings With Only 1sC++Medium
1470Shuffle the ArrayC++Easy
1464Maximum Product of Two Elements in an ArrayC++Easy
1460Make Two Arrays Equal by Reversing Sub-arraysC++Easy
1376Time Needed to Inform All EmployeesC++Medium
1375Bulb Switcher IIIC++Medium
1353Maximum Number of Events That Can Be AttendedC++Medium
1333Filter Restaurants by Vegan-Friendly, Price and DistanceC++Medium
1207Unique Number of OccurrencesC++Easy
1170Compare Strings by Frequency of the Smallest CharacterC++Easy
1071Greatest Common Divisor of StringsC++Easy
1030Matrix Cells in Distance OrderC++Easy
1029Two City SchedulingC++Easy
1028Recover a Tree From Preorder TraversalC++Hard
1024Video StitchingC++Medium
993Cousins in Binary TreeC++Easy
991Broken CalculatorC++Medium
990Satisfiability of Equality EquationsC++Medium
989Add to Array-Form of IntegerC++Easy
988Smallest String Starting From LeafC++Medium
987Vertical Order Traversal of a Binary TreeC++Medium
986Interval List IntersectionsC++Medium
985Sum of Even Numbers After QueriesC++Easy
984String Without AAA or BBBC++Easy
983Minimum Cost For TicketsC++Medium
982Triples with Bitwise AND Equal To ZeroC++Hard
981Time Based Key-Value StoreC++Medium
980Unique Paths IIIC++,PythonHard
979Distribute Coins in Binary TreeC++Medium
978Longest Turbulent SubarrayC++,PythonMedium
977Squares of a Sorted ArrayC++, PythonEasy
976Largest Perimeter TriangleC++, PythonEasy
971Flip Binary Tree To Match Preorder TraversalPythonMedium
969Pancake SortingPythonMedium
961N-Repeated element in size 2N ArrayC++Easy
958Check Completeness of a Binary TreePythonMedium
951Flip Equivalent Binary TreesPythonMedium
950Reveal Cards In Increasing OrderPythonMedium
941Valid Mountain ArrayPythonEasy
933Number of Recent CallsC++Easy
931Minimum Falling Path SumC++Medium
929Unique Email AddressesC++Easy
922Sort Array By Parity IIC++Easy
914X of a Kind in a Deck of CardsPythonEasy
905Sort Array By ParityC++Easy
876Middle of the Linked ListPythonEasy
859Buddy StringsC++Easy
858Mirror ReflectionC++Medium
852Peak Index in a Mountain ArrayC++Easy
849Maximize Distance to Closest PersonPythonEasy
844Backspace String CompareC++Easy
837Most Common WordC++Easy
830Positions of Large GroupsPythonEasy
820Short Encoding of WordsC++Medium
804Unique Morse Code WordsC++Easy
776Swim In Rising WaterPythonHard
771Jewels and StonesC++Easy
747Largest Number At Least Twice of OthersPythonEasy
746Min Cost Climbing StairsC++, PythonEasy
721Accounts MergeC++Medium
7171-bit and 2-bit CharactersPythonEasy
714Best Time to Buy and Sell Stock with Transaction FeeC++Medium
712Minimum ASCII Delete Sum for Two StringsC++Medium
695Max Area of IslandC++Medium
687Longest Univalue PathPythonEasy
684Redundant ConnectionPythonMedium
674Longest Continuous Increasing SubsequencePythonEasy
672Bulb Switcher IIC++Medium
671Second Minimum Node In a Binary TreePythonEasy
665Non-decreasing ArrayPythonEasy
662Maximum Width of Binary TreePythonMedium
661Image SmootherPythonEasy
655Print Binary TreePythonMedium
652Find Duplicate SubtreesPythonMedium
647Palindromic SubstringsC++Medium
643Maximum Average Subarray IC++, PythonEasy
628Maximum Product of Three NumbersPythonEasy
623Add One Row to TreePythonMedium
581Shortest Unsorted Continuous SubarrayPythonEasy
572Subtree of Another TreePythonEasy
563Binary Tree TiltPythonEasy
547Friend CirclesC++Medium
543Diameter of Binary TreeC++, PythonEasy
538Convert BST to Greater TreePythonEasy
532K-diff Pairs in an ArrayPythonEasy
520Detect CapitalC++Easy
518Coin Change 2C++Medium
516Longest Palindromic SubsequenceC++Medium
509Fibonacci NumberC++, PythonEasy
497Random Point in Non-overlapping RectanglesC++Medium
494Target SumC++Medium
477Total Hamming DistanceC++Medium
463Island PerimeterC++Easy
450DeleteNodeInABSTPythonMedium
449Serialize and Deserialize BSTPythonMedium
438Find all Anagrams in a stringC++Medium
437Path Sum IIIPythonMedium
418SentenceScreenFitting 🔒C++Easy
416Partition Equal Subset SumC++Medium
415Add StringsC++Easy
414Third Maximum NumberC++, PythonEasy
413Arithmetic SlicesC++Medium
412Fizz BuzzC++Easy
410Split Array Largest SumC++Hard
409Longest PalindromeC++Easy
406Queue Reconstruction by HeightC++Medium
405Convert a Number to HexadecimalC++Easy
404Sum of Left LeavesC++, PythonEasy
403Frog JumpC++Hard
402Remove K DigitsC++Medium
401Binary WatchC++Easy
400Nth DigitC++Medium
399Evaluate DivisionC++Medium
398Random Pick IndexC++Medium
397Integer ReplacementC++Medium
396Rotate FunctionC++Easy
395Longest Substring with At Least K Repeating CharactersC++Medium
394Decode StringC++Medium
393UTF-8 ValidationC++Medium
392Is SubsequenceC++Medium
391Perfect RectangleC++Hard
390Elimination GameC++Medium
389Find the DifferenceC++Easy
388Longest Absolute File PathC++Medium
387First Unique Character in a StringC++Easy
386Lexicographical NumbersC++Medium
385Mini ParserC++Medium
384Shuffle an ArrayC++Medium
383Ransom NoteC++Easy
382Linked List Random NodeC++Medium
381Insert Delete GetRandom O(1) - Duplicates allowedC++Hard
380Insert Delete GetRandom O(1)C++Hard
377Combination Sum IVC++Medium
376Wiggle SubsequenceC++Medium
371Sum of Two IntegersC++Easy
367Valid Perfect SquareC++Easy
357Count Numbers with Unique DigitsC++Medium
350Intersection of Two Arrays IIC++Easy
349Intersection of Two ArraysC++Easy
347Top K Frequent ElementsC++Medium
345Reverse Vowels of a StringC++Easy
344Reverse StringC++Easy
343Integer BreakC++Medium
342Power of FourC++Easy
341Flatten Nested List IteratorC++Medium
338Counting BitsC++Medium
337House Robber IIIC++, PythonMedium
336Palindrome PairsC++Hard
334Increasing Triplet SubsequenceC++Medium
332Reconstruct ItineraryC++Medium
331Verify Preorder Serialization of a Binary TreeC++Medium
330Patching ArrayC++Medium
329Longest Increasing Path in a MatrixC++Medium
328Odd Even Linked ListC++Easy
327Count of Range SumC++Hard
326Power of ThreeC++Easy
324Wiggle Sort IIC++Medium
322Coin ChangeC++Medium
321Create Maximum NumberC++Hard
319Bulb SwitcherC++Medium
318Maximum Product of Word LengthsC++Medium
316Remove Duplicate LettersC++Hard
315Count of Smaller Numbers After SelfC++Hard
313Super Ugly NumberC++Medium
312Burst BalloonsC++Hard
310Minimum Height TreesC++Medium
309Best Time to Buy and Sell Stock with CooldownC++Medium
307Range Sum Query - MutableC++Medium
306Additive NumberC++Medium
304Range Sum Query 2D - ImmutableC++Medium
303Range Sum Query - ImmutableC++Easy
301Remove Invalid ParenthesesC++Hard
300Longest Increasing SubsequenceC++Medium
299Bulls and CowsC++Easy
297Serialize and Deserialize Binary TreeC++Medium
295Find Median from Data StreamC++Hard
292Nim GameC++Easy
290Word PatternC++Easy
289Game of LifeC++Medium
287Find the Duplicate NumberC++, PythonHard
285Inorder Successor in BST 🔒JavaMedium
284Peeking IteratorC++Medium
283Move ZeroesC++Easy
282Expression Add OperatorsC++Hard
279Perfect SquaresC++Medium
278First Bad VersionC++, JavaEasy
275H-Index IIC++Medium
274H-IndexC++Medium
273Integer to English WordsC++Medium
268Missing NumberC++Medium
264Ugly Number IIC++Medium
263Ugly NumberC++Easy
260Single Number IIIC++Medium
258Add DigitsC++Easy
257Binary Tree PathsC++Easy
242Valid AnagramC++, JavaEasy
241Different Ways to Add ParenthesesC++, PythonMedium
240Search a 2D Matrix IIC++, Java, PythonMedium
239Sliding Window MaximumC++Hard
238Product of Array Except SelfC++Medium
237Delete Node in a Linked ListC++Easy
236Lowest Common Ancestor of a Binary TreeC++, Java, PythonMedium
235Lowest Common Ancestor of a Binary Search TreeC++, PythonEasy
234Palindrome Linked ListC++Easy
233Number of Digit OneC++Medium
232Implement Queue using StacksC++, JavaEasy
231Power of TwoC++Easy
230Kth Smallest Element in a BSTC++, PythonMedium
229Majority Element IIC++Medium
228Summary RangesC++Easy
227Basic Calculator IIC++Medium
226Invert Binary TreeC++Easy
225Implement Stack using QueuesC++, JavaMedium
224Basic CalculatorC++Medium
223Rectangle AreaC++Easy
222Count Complete Tree NodesC++, PythonMedium
221Maximal SquareC++Medium
220Contains Duplicate IIIC++, PythonMedium
219Contains Duplicate IIC++, PythonEasy
218The Skyline ProblemC++Hard
217Contains DuplicateC++Easy
216Combination Sum IIIC++Medium
215Kth Largest Element in an ArrayC++Medium
214Shortest PalindromeC++Hard
213House Robber IIC++Medium
212Word Search IIC++Hard
211Add and Search Word - Data structure designC++Medium
210Course Schedule IIC++Medium
209Minimum Size Subarray SumC++Medium
208Implement Trie (Prefix Tree)C++Medium
207Course ScheduleC++Medium
206Reverse Linked ListC++, JavaEasy
205Isomorphic StringsC++Easy
204Count PrimesC++Easy
203Remove Linked List ElementsC++Easy
202Happy NumberC++, PythonEasy
201Bitwise AND of Numbers RangeC++Medium
200Number of IslandsC++, PythonMedium
199Binary Tree Right Side ViewC++Medium
198House RobberC++, PythonEasy
191Number of 1 BitsC++Easy
190Reverse BitsC++Easy
189Rotate ArrayC++, JavaEasy
188Best Time to Buy and Sell Stock IVC++Hard
187Repeated DNA SequencesC++Medium
186Reverse Words in a String II 🔒C++Medium
179Largest NumberC++Medium
174Dungeon GameC++Hard
173Binary Search Tree IteratorC++, Java, PythonMedium
172Factorial Trailing ZeroesC++Easy
171Excel Sheet Column NumberC++Easy
170Two Sum III - Data structure design 🔒C++Easy
169Majority ElementC++Easy
168Excel Sheet Column TitleC++Easy
167Two Sum II - Input array is sorted 🔒C++Medium
166Fraction to Recurring DecimalC++Medium
165Compare Version NumbersC++Easy
164Maximum GapC++Hard
163Missing Ranges 🔒C++Medium
162Find Peak ElementC++, JavaMedium
161One Edit Distance🔒C++Medium
160Intersection of Two Linked ListsC++Easy
159Longest Substring with At Most Two Distinct Characters 🔒C++Hard
158Read N Characters Given Read4 II - Call multiple times 🔒C++Hard
157Read N Characters Given Read4 🔒C++Easy
156Binary Tree Upside Down 🔒C++Medium
155Min StackC++, JavaEasy
154Find Minimum in Rotated Sorted Array IIC++Hard
153Find Minimum in Rotated Sorted ArrayC++, JavaMedium
152Maximum Product SubarrayC++Medium
151Reverse Words in a StringC++, JavaMedium
150Evaluate Reverse Polish NotationC++Medium
149Max Points on a LineC++Hard
148Sort ListC++, PythonMedium
147Insertion Sort ListC++, PythonMedium
146LRU CacheC++, JavaHard
145Binary Tree Postorder TraversalC++, PythonHard
144Binary Tree Preorder TraversalC++, JavaMedium
143Reorder ListC++, PythonMedium
142Linked List Cycle IIC++, PythonMedium
141Linked List CycleC++Medium
140Word Break IIC++Hard
139Word BreakC++Medium
138Copy List with Random PointerC++, PythonHard
137Single Number IIC++, PythonMedium
136Single NumberC++Medium
135CandyC++Hard
134Gas StationC++Medium
133Clone GraphC++Medium
132Palindrome Partitioning IIC++Hard
131Palindrome PartitioningC++Medium
130Surrounded RegionsC++Medium
129Sum Root to Leaf NumbersC++, PythonMedium
128Longest Consecutive SequenceC++, PythonMedium
127Word LadderC++Medium
126Word Ladder IIC++Hard
125Valid PalindromeC++, JavaEasy
124Binary Tree Maximum Path SumC++, JavaHard
123Best Time to Buy and Sell Stock IIIC++Hard
122Best Time to Buy and Sell Stock IIC++Medium
121Best Time to Buy and Sell StockC++Medium
120TriangleC++, JavaMedium
119Pascal's Triangle IIC++Easy
118Pascal's TriangleC++Easy
117Populating Next Right Pointers in Each Node IIC++, PythonHard
116Populating Next Right Pointers in Each NodeC++, PythonMedium
115Distinct SubsequencesC++Hard
114Flatten Binary Tree to Linked ListC++, PythonMedium
113Path Sum IIC++, PythonMedium
112Path SumC++Easy
111Minimum Depth of Binary TreeC++Easy
110Balanced Binary TreeC++, JavaEasy
109Convert Sorted List to Binary Search TreeC++Medium
108Convert Sorted Array to Binary Search TreeC++Medium
107Binary Tree Level Order Traversal IIC++Easy
106Construct Binary Tree from Inorder and Postorder TraversalC++, PythonMedium
105Construct Binary Tree from Preorder and Inorder TraversalC++, PythonMedium
104Maximum Depth of Binary TreeC++, JavaEasy
103Binary Tree Zigzag Level Order TraversalC++, PythonMedium
102Binary Tree Level Order TraversalC++, JavaEasy
101Symmetric TreeC++Easy
100Same TreeC++Easy
99Recover Binary Search TreeC++Hard
98Validate Binary Search TreeC++, Java, PythonMedium
97Interleaving StringC++Hard
96Unique Binary Search TreesC++, PythonMedium
95Unique Binary Search Trees IIC++, PythonMedium
94Binary Tree Inorder TraversalC++Medium
93Restore IP AddressesC++Medium
92Reverse Linked List IIC++, Java, PythonMedium
91Decode WaysC++Medium
90Subsets IIC++, JavaMedium
89Gray CodeC++Medium
88Merge Sorted ArrayC++Easy
87Scramble StringC++Hard
86Partition ListC++, PythonMedium
85Maximal RectangleC++Hard
84Largest Rectangle in HistogramC++Hard
83Remove Duplicates from Sorted ListC++Easy
82Remove Duplicates from Sorted List IIC++, PythonMedium
81Search in Rotated Sorted Array IIC++Medium
80Remove Duplicates from Sorted Array IIC++Medium
79Word SearchC++Medium
78SubsetsC++, Java, PythonMedium
77CombinationsC++Medium
76Minimum Window SubstringC++Hard
75Sort ColorsC++Medium
74Search a 2D MatrixC++, JavaMedium
73Set Matrix ZeroesC++Medium
72Edit DistanceC++Hard
71Simplify PathC++Medium
70Climbing StairsC++, JavaEasy
69Sqrt(x)C++Medium
68Text JustificationC++Hard
67Add BinaryC++Easy
66Plus OneC++Easy
65Valid NumberC++Easy
64Minimum Path SumC++, JavaMedium
63Unique Paths IIC++, JavaMedium
62Unique PathsC++, JavaMedium
61Rotate ListC++Medium
60Permutation SequenceC++Medium
59Spiral Matrix IIC++Medium
58Length of Last WordC++, JavaEasy
57Insert IntervalC++Hard
56Merge IntervalsC++Hard
55Jump GameC++, PythonMedium
54Spiral MatrixC++Medium
53Maximum SubarrayC++, JavaMedium
52N-Queens IIC++Hard
51N-QueensC++Hard
50"Pow(x, n)"C++, JavaMedium
49Group AnagramsC++Medium
48Rotate ImageC++, JavaMedium
47Permutations IIC++Hard
46PermutationsC++Medium
45Jump Game IIC++Hard
44Wildcard MatchingC++Hard
43Multiply StringsC++Medium
42Trapping Rain WaterC++Hard
41First Missing PositiveC++, PythonHard
40Combination Sum IIC++Medium
39Combination SumC++Medium
38Count and SayC++, JavaEasy
37Sudoku SolverC++Hard
36Valid SudokuC++Easy
35Search Insert PositionC++, JavaMedium
34Search for a RangeC++, JavaMedium
33Search in Rotated Sorted ArrayC++, JavaHard
32Longest Valid ParenthesesC++Hard
31Next PermutationC++Medium
30Substring with Concatenation of All WordsC++Hard
29Divide Two IntegersC++Medium
28Implement strStr()C++, JavaEasy
27Remove ElementC++Easy
26Remove Duplicates from Sorted ArrayC++, JavaEasy
25Reverse Nodes in k-GroupC++Hard
24Swap Nodes in PairsC++Medium
23Merge k Sorted ListsC++Hard
22Generate ParenthesesC++Medium
21Merge Two Sorted ListsC++Easy
20Valid ParenthesesC++Easy
19Remove Nth Node From End of ListC++, PythonEasy
184SumC++Medium
17Letter Combinations of a Phone NumberC++Medium
163Sum ClosestC++Medium
153SumC++Medium
14Longest Common PrefixC++Easy
13Roman to IntegerC++Easy
12Integer to RomanC++Medium
11Container With Most WaterC++, JavaMedium
10Regular Expression MatchingC++Hard
9Palindrome NumberC++, JavaEasy
8String to Integer (atoi)C++Easy
7Reverse IntegerC++Easy
6ZigZag ConversionC++Easy
5Longest Palindromic SubstringC++Medium
4Median of Two Sorted ArraysC++Hard
3Longest Substring Without Repeating CharactersC++Medium
2Add Two NumbersC++Medium
1Two SumC++, GoEasy

LeetCode Shell

#TitleSolutionDifficulty
4Tenth LineBashEasy
3Transpose FileBashMedium
2Valid Phone NumbersBashEasy
1Word FrequencyBashMedium

LintCode

#TitleSolutionDifficulty
1Search in a big sorted arrayJavaMedium
2Search Range in Binary Search TreeJavaMedium