Skip to content

Solution to Leetcode problems. 在此记录 Leetcode 题目的解法思路,以C++为主。

License

Notifications You must be signed in to change notification settings

convexwf/leetcode

Repository files navigation

Leetcode Solution

All Locked Unlocked Easy Medium Hard
1056 153 903 240 599 217

Table of Leetcode Solution

Title Difficulty Tags Solution
0001.Two Sum Easy (52.31%) array, hash-table, sort cpp, rust
0002.Add Two Numbers Medium (42.66%) linked-list, arithmetic cpp
0003.Longest Substring Without Repeating Characters Medium (34.70%) hash-table, sliding-window cpp
0004.Median of Two Sorted Arrays Hard (39.79%) array, binary-search, divide-and-conquer cpp
0005.Longest Palindromic Substring Medium (33.77%) string, dynamic-programming, palindrome cpp
0006.Zigzag Conversion Medium (47.76%) string cpp
0007.Reverse Integer Medium (28.52%) math cpp
0008.String to Integer (atoi) Medium (17.18%) math, string cpp
0009.Palindrome Number Easy (56.14%) math, palindrome cpp
0010.Regular Expression Matching Hard (28.14%) dynamic-programming, backtracking, string cpp
0011.Container With Most Water Medium (55.13%) array, two-pointers cpp
0012.Integer to Roman Medium (64.59%) greedy cpp
0013.Roman to Integer Easy (61.05%) hash-table, string cpp
0014.Longest Common Prefix Easy (42.67%) string, sort cpp
0015.3Sum Medium (34.41%) array, two-pointers, sorting, target-sum cpp
0016.3Sum Closest Medium (45.79%) array, two-pointers, sorting, target-sum cpp
0017.Letter Combinations of a Phone Number Medium (60.27%) string, backtracking, depth-first-search, breadth-first-search, recursion cpp
0018.4Sum Medium (36.23%) array, two-pointers, target-sum cpp
0019.Remove Nth Node From End of List Medium (45.15%) linked-list, fast-slow-pointers cpp
0020.Valid Parentheses Easy (40.54%) string, stack cpp
0021.Merge Two Sorted Lists Easy (64.18%) linked-list cpp
0022.Generate Parentheses Medium (74.44%) string, backtracking, parentheses cpp
0023.Merge k Sorted Lists Hard (52.59%) linked-list, heap cpp
0024.Swap Nodes in Pairs Medium (64.24%) linked-list, recursion cpp
0025.Reverse Nodes in k-Group Hard (58.47%) linked-list cpp
0026.Remove Duplicates from Sorted Array Easy (55.42%) array, two-pointers, in-place-algorithm cpp
0027.Remove Element Easy (56.58%) array, two-pointers, in-place-algorithm cpp
0028.Find the Index of the First Occurrence in a String Easy (42.16%) string
0029.Divide Two Integers Medium (17.43%) math, arithmetic, bit-manipulation cpp
0030.Substring with Concatenation of All Words Hard (32.51%) hash-table, sliding-window, string cpp
0031.Next Permutation Medium (39.77%) array, permutation cpp
0032.Longest Valid Parentheses Hard (34.08%) string, dynamic-programming, stack, parentheses, subarray cpp
0033.Search in Rotated Sorted Array Medium (40.66%) array, binary-search, search-in-rotated-sorted-array cpp
0034.Find First and Last Position of Element in Sorted Array Medium (44.19%) array, binary-search cpp
0035.Search Insert Position Easy (45.77%) array, binary-search cpp
0036.Valid Sudoku Medium (59.55%) hash-table, bit-manipulation cpp
0037.Sudoku Solver Hard (60.92%) hash-table, backtracking, bit-manipulation cpp
0038.Count and Say Medium (54.89%) string, recursion cpp
0039.Combination Sum Medium (71.28%) sort, backtracking, combination cpp
0040.Combination Sum II Medium (54.43%) array, backtracking, sort, combination cpp
0041.First Missing Positive Hard (39.42%) array cpp
0042.Trapping Rain Water Hard (61.04%) array, two-pointers, monotonic-stack, stack cpp
0043.Multiply Strings Medium (40.29%) string, arithmetic cpp
0044.Wildcard Matching Hard (27.85%) dynamic-programming, backtracking, string cpp
0045.Jump Game II Medium (40.41%) array, greedy cpp
0046.Permutations Medium (78.23%) depth-first-search, backtracking cpp
0047.Permutations II Medium (59.09%) depth-first-search, backtracking, hash-table cpp
0048.Rotate Image Medium (74.15%) array, matrix cpp
0049.Group Anagrams Medium (68.43%) hash-table, string, sort cpp
0050.Pow(x, n) Medium (34.70%) math, divide-and-conquer, bit-manipulation cpp
0051.N-Queens Hard (67.99%) backtracking cpp
0052.N-Queens II Hard (73.76%) backtracking cpp
0053.Maximum Subarray Medium (50.72%) divide-and-conquer, dynamic-programming, array, subarray cpp
0054.Spiral Matrix Medium (49.28%) matrix, array cpp
0055.Jump Game Medium (38.50%) array, greedy cpp
0056.Merge Intervals Medium (47.24%) sort, interval cpp
0057.Insert Interval Medium (41.42%) sort, interval, array cpp
0058.Length of Last Word Easy (51.26%) string, two-pointers cpp
0059.Spiral Matrix II Medium (70.98%) array, matrix cpp
0060.Permutation Sequence Hard (46.75%) math, permutation cpp
0061.Rotate List Medium (37.64%) linked-list, fast-slow-pointers cpp
0062.Unique Paths Medium (64.23%) dynamic-programming, math cpp
0063.Unique Paths II Medium (41.49%) dynamic-programming cpp
0064.Minimum Path Sum Medium (63.76%) dynamic-programming cpp
0065.Valid Number Hard (19.72%) string, finite-automata cpp
0066.Plus One Easy (45.16%) array cpp
0067.Add Binary Easy (53.45%) string, math cpp
0068.Text Justification Hard (43.18%) string, greedy cpp
0069.Sqrt(x) Easy (38.68%) math, binary-search cpp
0070.Climbing Stairs Easy (52.85%) dynamic-programming, fibonacci-number cpp
0071.Simplify Path Medium (42.23%) string, stack cpp
0072.Edit Distance Medium (56.31%) string, dynamic-programming cpp
0073.Set Matrix Zeroes Medium (55.42%) array cpp
0074.Search a 2D Matrix Medium (50.00%) matrix, binary-search cpp
0075.Sort Colors Medium (62.07%) array, two-pointers, sort cpp
0076.Minimum Window Substring Hard (42.90%) hash-table, sliding-window, string cpp
0077.Combinations Medium (70.28%) backtracking, divide-and-conquer, combination cpp
0078.Subsets Medium (77.35%) array, backtracking, bit-manipulation, subset cpp
0079.Word Search Medium (42.66%) matrix, backtracking, depth-first-search cpp
0080.Remove Duplicates from Sorted Array II Medium (57.95%) in-place algorithm, array cpp
0081.Search in Rotated Sorted Array II Medium (37.62%) array, binary-search, search-in-rotated-sorted-array cpp
0082.Remove Duplicates from Sorted List II Medium (47.34%) linked-list cpp
0083.Remove Duplicates from Sorted List Easy (52.41%) linked-list, duplicate cpp
0084.Largest Rectangle in Histogram Hard (44.23%) monotonic-stack, array cpp
0085.Maximal Rectangle Hard (47.03%) matrix, stack, monotonic-stack cpp
0086.Partition List Medium (56.17%) linked-list cpp
0087.Scramble String Hard (40.03%) string, dynamic-programming, memoization cpp
0088.Merge Sorted Array Easy (49.48%) array, two-pointers cpp
0089.Gray Code Medium (59.07%) hash-table, backtracking, bit-manipulation cpp
0090.Subsets II Medium (57.18%) array, backtracking, bit-manipulation cpp
0091.Decode Ways Medium (34.81%) string, dynamic-programming cpp
0092.Reverse Linked List II Medium (47.62%) linked-list cpp
0093.Restore IP Addresses Medium (49.73%) string, backtracking, depth-first-search cpp
0094.Binary Tree Inorder Traversal Easy (76.01%) stack, binary-tree cpp
0095.Unique Binary Search Trees II Medium (57.62%) recursion, binary-search-tree, binary-tree cpp
0096.Unique Binary Search Trees Medium (60.96%) dynamic-programming, binary-search-tree, binary-tree, math cpp
0097.Interleaving String Medium (39.89%) string, dynamic-programming, depth-first-search, memoization, hash-table cpp
0098.Validate Binary Search Tree Medium (32.87%) binary-search-tree, binary-tree cpp
0099.Recover Binary Search Tree Medium (53.00%) binary-search-tree, binary-tree, depth-first-search, sort cpp
0100.Same Tree Easy (61.96%) binary-tree, depth-first-search, breadth-first-search cpp
0101.Symmetric Tree Easy (56.37%) binary-tree, depth-first-search, breadth-first-search cpp
0102.Binary Tree Level Order Traversal Medium (67.05%) binary-tree, breadth-first-search cpp
0103.Binary Tree Zigzag Level Order Traversal Medium (58.84%) binary-tree, breadth-first-search cpp
0104.Maximum Depth of Binary Tree Easy (75.27%) binary-tree, depth-first-search, breadth-first-search cpp
0105.Construct Binary Tree from Preorder and Inorder Traversal Medium (63.76%) binary-tree, hash-table cpp
0106.Construct Binary Tree from Inorder and Postorder Traversal Medium (62.67%) binary-tree, hash-table cpp
0107.Binary Tree Level Order Traversal II Medium (63.28%) binary-tree, breadth-first-search, depth-first-search cpp
0108.Convert Sorted Array to Binary Search Tree Easy (71.58%) binary-tree, array, depth-first-search cpp
0109.Convert Sorted List to Binary Search Tree Medium (61.80%) linked-list, binary-search-tree, fast-slow-pointers cpp
0110.Balanced Binary Tree Easy (51.90%) binary-tree, depth-first-search cpp
0111.Minimum Depth of Binary Tree Easy (47.76%) binary-tree, depth-first-search, breadth-first-search cpp
0112.Path Sum Easy (50.24%) binary-tree, path-sum cpp
0113.Path Sum II Medium (58.38%) binary-tree, path-sum cpp
0114.Flatten Binary Tree to Linked List Medium (64.76%) binary-tree, depth-first-search, linked-list cpp
0115.Distinct Subsequences Hard (46.77%) dynamic-programming, string cpp
0116.Populating Next Right Pointers in Each Node Medium (62.56%) binary-tree cpp
0117.Populating Next Right Pointers in Each Node II Medium (52.37%) binary-tree cpp
0118.Pascal's Triangle Easy (74.11%) array cpp
0119.Pascal's Triangle II Easy (63.90%) array, math cpp
0120.Triangle Medium (56.45%) dynamic-programming cpp
0121.Best Time to Buy and Sell Stock Easy (53.60%) array, best-time-to-buy-and-sell-stock cpp
0122.Best Time to Buy and Sell Stock II Medium (66.32%) array, greedy, best-time-to-buy-and-sell-stock cpp
0123.Best Time to Buy and Sell Stock III Hard (47.84%) array, greedy, dynamic-programming, best-time-to-buy-and-sell-stock cpp
0124.Binary Tree Maximum Path Sum Hard (39.99%) binary-tree, depth-first-search cpp
0125.Valid Palindrome Easy (47.30%) string, two-pointers cpp
0126.Word Ladder II Hard (27.29%) string, backtracking, breadth-first-search, depth-first-search cpp
0127.Word Ladder Hard (39.04%) breadth-first-search, hash-table cpp
0128.Longest Consecutive Sequence Medium (47.29%) array, hash-table, sort cpp
0129.Sum Root to Leaf Numbers Medium (63.68%) binary-tree, depth-first-search, breadth-first-search cpp
0130.Surrounded Regions Medium (39.26%) depth-first-search, breadth-first-search, union-find, matrix cpp
0131.Palindrome Partitioning Medium (67.41%) depth-first-search, backtracking, palindrome cpp
0132.Palindrome Partitioning II Hard (33.89%) dynamic-programming, palindrome, string cpp
0133.Clone Graph Medium (57.06%) hash-table, depth-first-search, breadth-first-search, graph, deep-copy cpp
0134.Gas Station Medium (45.52%) greedy, math cpp
0135.Candy Hard (43.27%) array, greedy cpp
0136.Single Number Easy (72.74%) bit-manipulation cpp
0137.Single Number II Medium (62.51%) bit-manipulation cpp
0138.Copy List with Random Pointer Medium (55.92%) linked-list, hash-table, design, deep-copy cpp
0139.Word Break Medium (46.72%) dynamic-programming, hash-table, string cpp
0140.Word Break II Hard (47.85%) depth-first-search, memorization cpp
0141.Linked List Cycle Easy (50.31%) linked-list, two-pointers, hash-table, fast-slow-pointers cpp
0142.Linked List Cycle II Medium (51.17%) linked-list, fast-slow-pointers cpp
0143.Reorder List Medium (58.51%) linked-list, fast-slow-pointers, stack cpp
0144.Binary Tree Preorder Traversal Easy (69.37%) binary-tree, stack cpp
0145.Binary Tree Postorder Traversal Easy (70.78%) binary-tree cpp
0146.LRU Cache Medium (42.38%) design cpp
0147.Insertion Sort List Medium (53.40%) sort, linked-list cpp
0148.Sort List Medium (57.73%) linked-list, merge-sort cpp
0149.Max Points on a Line Hard (26.62%) hash-table, math, geometry cpp
0150.Evaluate Reverse Polish Notation Medium (51.26%) stack cpp
0151.Reverse Words in a String Medium (41.82%) string, two-pointers cpp
0152.Maximum Product Subarray Medium (35.03%) array, dynamic-programming cpp
0153.Find Minimum in Rotated Sorted Array Medium (50.26%) array, binary-search, search-in-rotated-sorted-array, divide-and-conquer cpp
0154.Find Minimum in Rotated Sorted Array II Hard (43.66%) array, binary-search, search-in-rotated-sorted-array, divide-and-conquer cpp
0155.Min Stack Medium (54.05%) stack, design cpp
0156.Binary Tree Upside Down 🔒 Medium (62.71%) binary-tree cpp
0157.Read N Characters Given Read4 🔒 Easy (41.47%) string, design cpp
0158.Read N Characters Given read4 II - Call Multiple Times 🔒 Hard (42.23%) string, design cpp
0159.Longest Substring with At Most Two Distinct Characters 🔒 Medium (55.30%) sliding-window, hash-table, string cpp
0160.Intersection of Two Linked Lists Easy (57.30%) linked-list, two-pointers cpp
0161.One Edit Distance 🔒 Medium (34.28%) string cpp
0162.Find Peak Element Medium (45.93%) array, binary-search cpp
0163.Missing Ranges 🔒 Easy (33.58%) array, interval cpp
0164.Maximum Gap Medium (45.79%) sort, bucket-sort, array cpp
0165.Compare Version Numbers Medium (36.83%) string, two-pointers cpp
0166.Fraction to Recurring Decimal Medium (24.97%) hash-table, arithmetic cpp
0167.Two Sum II - Input Array Is Sorted Medium (61.16%) array, two-pointers, binary-search cpp
0168.Excel Sheet Column Title Easy (40.54%) math, string, easy cpp
0169.Majority Element Easy (64.78%) sort, array, bit-manipulation, boyer-moore-voting-algorithm cpp
0170.Two Sum III - Data structure design 🔒 Easy (38.00%) design, hash-table, target-sum cpp
0171.Excel Sheet Column Number Easy (63.66%) math cpp
0172.Factorial Trailing Zeroes Medium (43.28%) math cpp
0173.Binary Search Tree Iterator Medium (71.88%) design, stack, binary-tree cpp
0174.Dungeon Game Hard (38.07%) dynamic-programming, matrix cpp
0179.Largest Number Medium (36.04%) sort, string cpp
0186.Reverse Words in a String II 🔒 Medium (54.52%) string, two-pointers cpp
0187.Repeated DNA Sequences Medium (48.78%) hash-table, bit-manipulation, string cpp
0188.Best Time to Buy and Sell Stock IV Hard (42.57%) dynamic-programming, best-time-to-buy-and-sell-stock cpp
0189.Rotate Array Medium (40.50%) array cpp
0190.Reverse Bits Easy (58.30%) bit-manipulation cpp
0191.Number of 1 Bits Easy (70.75%) bit-manipulation cpp
0198.House Robber Medium (50.95%) dynamic-programming, array cpp
0199.Binary Tree Right Side View Medium (62.99%) binary-tree cpp
0200.Number of Islands Medium (58.75%) depth-first-search, breadth-first-search cpp
0201.Bitwise AND of Numbers Range Medium (46.86%) bit-manipulation cpp
0202.Happy Number Easy (56.02%) hash-table, math, fast-slow-pointers cpp
0203.Remove Linked List Elements Easy (48.63%) linked-list cpp
0204.Count Primes Medium (33.56%) math cpp
0205.Isomorphic Strings Easy (45.08%) hash-table cpp
0206.Reverse Linked List Easy (76.41%) linked-list cpp
0207.Course Schedule Medium (46.68%) graph, topological-sort, depth-first-search, breadth-first-search cpp
0208.Implement Trie (Prefix Tree) Medium (64.99%) design, trie-tree cpp
0209.Minimum Size Subarray Sum Medium (47.01%) array, sliding-window, binary-search, prefix-sum cpp
0210.Course Schedule II Medium (50.32%) graph, topological-sort cpp
0211.Design Add and Search Words Data Structure Medium (45.13%) trie, backtracking, design, depth-first-search cpp
0212.Word Search II Hard (36.26%) trie, depth-first-search, backtracking, matrix cpp
0213.House Robber II Medium (41.92%) dynamic-programming cpp
0214.Shortest Palindrome Hard (33.37%) string, palindrome cpp
0215.Kth Largest Element in an Array Medium (66.78%) heap, sort, divide-and-conquer, partition, array cpp
0216.Combination Sum III Medium (69.54%) backtracking, combination cpp
0217.Contains Duplicate Easy (61.59%) array, sort, hash-table, duplicate cpp
0218.The Skyline Problem Hard (42.64%) sort, multiset cpp
0219.Contains Duplicate II Easy (44.96%) array, hash-table, duplicate cpp
0220.Contains Duplicate III Hard (22.72%) sliding-window, ordered-map, binary-search cpp
0221.Maximal Square Medium (46.44%) dynamic-programming, matrix, prefix-sum cpp
0222.Count Complete Tree Nodes Easy (64.95%) binary-tree, recursion cpp
0223.Rectangle Area Medium (46.13%) math, geometry cpp
0224.Basic Calculator Hard (43.36%) math, design, arithmetic, basic-calculator cpp
0225.Implement Stack using Queues Easy (63.52%) stack, queue, design cpp
0226.Invert Binary Tree Easy (76.86%) binary-tree, recursion cpp
0227.Basic Calculator II Medium (43.53%) string, basic-calculator, stack, math, arithmetic cpp
0228.Summary Ranges Easy (50.52%) array cpp
0229.Majority Element II Medium (51.36%) array, boyer-moore-voting-algorithm cpp
0230.Kth Smallest Element in a BST Medium (72.39%) binary-tree, binary-search-tree, divide-and-conquer cpp
0231.Power of Two Easy (47.74%) bit-manipulation cpp
0232.Implement Queue using Stacks Easy (66.16%) stack, queue, design cpp
0233.Number of Digit One Hard (34.56%) math, digit cpp
0234.Palindrome Linked List Easy (53.06%) linked-list, fast-slow-pointers, stack, recursion cpp
0235.Lowest Common Ancestor of a Binary Search Tree Medium (64.58%) binary-search-tree cpp
0236.Lowest Common Ancestor of a Binary Tree Medium (62.02%) binary-tree cpp
0237.Delete Node in a Linked List Medium (78.35%) linked-list cpp
0238.Product of Array Except Self Medium (66.09%) array cpp
0239.Sliding Window Maximum Hard (46.55%) heap, sliding-window, monotonic-stack, deque, multiset cpp
0240.Search a 2D Matrix II Medium (52.54%) binary-search, matrix cpp
0241.Different Ways to Add Parentheses Medium (65.35%) divide-and-conquer, memoization cpp
0242.Valid Anagram Easy (64.43%) hash-table cpp
0243.Shortest Word Distance 🔒 Easy (65.30%) string, two-pointers cpp
0244.Shortest Word Distance II 🔒 Medium (61.16%) design, hash-table, two-pointers cpp
0245.Shortest Word Distance III 🔒 Medium (58.42%) string, two-pointers cpp
0246.Strobogrammatic Number 🔒 Easy (47.68%) two-pointers cpp
0247.Strobogrammatic Number II 🔒 Medium (52.23%) recursion, string cpp
0248.Strobogrammatic Number III 🔒 Hard (42.11%) string, recursion cpp
0249.Group Shifted Strings 🔒 Medium (65.51%) hash-table, string cpp
0250.Count Univalue Subtrees 🔒 Medium (56.38%) binary-tree, depth-first-search cpp
0251.Flatten 2D Vector 🔒 Medium (49.45%) design, two-pointers cpp
0252.Meeting Rooms 🔒 Easy (58.02%) sort, interval cpp
0253.Meeting Rooms II 🔒 Medium (51.22%) array, difference-array, interval cpp
0254.Factor Combinations 🔒 Medium (49.47%) backtracking, math cpp
0255.Verify Preorder Sequence in Binary Search Tree 🔒 Medium (49.51%) monotonic-stack, binary-search-tree, binary-tree cpp
0256.Paint House 🔒 Medium (62.41%) dynamic-programming cpp
0257.Binary Tree Paths Easy (63.51%) binary-tree, depth-first-search cpp
0258.Add Digits Easy (66.53%) math cpp
0259.3Sum Smaller 🔒 Medium (50.71%) array, two-pointers, sort cpp
0260.Single Number III Medium (68.35%) bit-manipulation cpp
0261.Graph Valid Tree 🔒 Medium (48.03%) tree, graph, union-find cpp
0263.Ugly Number Easy (41.95%) easy cpp
0264.Ugly Number II Medium (46.18%) heap, math, dynamic-programming cpp
0265.Paint House II 🔒 Hard (54.60%) dynamic-programming cpp
0266.Palindrome Permutation 🔒 Easy (67.15%) string, hash-table, palindrome, permutation cpp
0267.Palindrome Permutation II 🔒 Medium (41.32%) string, permutation, palindrome, backtracking, hash-table cpp
0268.Missing Number Easy (66.68%) math, array, bit-manipulation, binary-search cpp
0269.Alien Dictionary 🔒 Hard (35.72%) graph, topological-sort, string cpp
0270.Closest Binary Search Tree Value 🔒 Easy (51.80%) binary-search-tree, binary-tree, recursion cpp
0271.Encode and Decode Strings 🔒 Medium (46.31%) string, design cpp
0272.Closest Binary Search Tree Value II 🔒 Hard (59.01%) stack, queue, binary-search-tree, binary-tree cpp
0273.Integer to English Words Hard (30.56%) math, string, hash-table cpp
0274.H-Index Medium (38.89%) sort, array, hash-table cpp
0275.H-Index II Medium (38.09%) binary-search cpp
0276.Paint Fence 🔒 Medium (46.53%) dynamic-programming cpp
0277.Find the Celebrity 🔒 Medium (47.14%) array, graph cpp
0278.First Bad Version Easy (44.33%) binary-search cpp
0279.Perfect Squares Medium (54.75%) math, dynamic-programming cpp
0280.Wiggle Sort 🔒 Medium (67.64%) sort, array cpp
0281.Zigzag Iterator 🔒 Medium (63.78%) design cpp
0282.Expression Add Operators Hard (39.82%) recursion, string cpp
0283.Move Zeroes Easy (61.71%) array, two-pointers, in-place-algorithm cpp
0284.Peeking Iterator Medium (59.44%) design cpp
0285.Inorder Successor in BST 🔒 Medium (49.63%) binary-search-tree, binary-tree, stack, recursion cpp
0286.Walls and Gates 🔒 Medium (61.31%) breadth-first-search cpp
0287.Find the Duplicate Number Medium (60.69%) array, duplicate, binary-search, bit-manipulation, fast-slow-pointers cpp
0288.Unique Word Abbreviation 🔒 Medium (26.22%) hash-table, string cpp
0289.Game of Life Medium (69.02%) matrix, bit-manipulation, in-place-algorithm cpp
0290.Word Pattern Easy (42.00%) hash-table, string cpp
0291.Word Pattern II 🔒 Medium (47.58%) backtracking, string, hash-table cpp
0292.Nim Game Easy (56.81%) math, game-theory cpp
0293.Flip Game 🔒 Easy (64.56%) string cpp
0294.Flip Game II 🔒 Medium (52.12%) game, backtracking cpp
0295.Find Median from Data Stream Hard (51.86%) design, heap cpp
0296.Best Meeting Point 🔒 Hard (60.90%) math, sort cpp
0297.Serialize and Deserialize Binary Tree Hard (56.66%) binary-tree, design, serialization cpp
0298.Binary Tree Longest Consecutive Sequence 🔒 Medium (53.46%) binary-tree, depth-first-search cpp
0299.Bulls and Cows Medium (50.24%) hash-table cpp
0300.Longest Increasing Subsequence Medium (55.23%) array, dynamic-programming, greedy, binary-search cpp
0301.Remove Invalid Parentheses Hard (48.14%) breadth-first-search, hash-table, parentheses, TODO cpp
0302.Smallest Rectangle Enclosing Black Pixels 🔒 Hard (58.87%) binary-search, matrix, geometry cpp
0303.Range Sum Query - Immutable Easy (63.17%) prefix-sum, math, array, interval cpp
0304.Range Sum Query 2D - Immutable Medium (54.46%) prefix-sum, math, matrix, interval cpp
0305.Number of Islands II 🔒 Hard (39.59%) union-find cpp
0306.Additive Number Medium (31.53%) backtracking, string cpp
0307.Range Sum Query - Mutable Medium (40.93%) array, interval, binary-indexed-tree cpp
0308.Range Sum Query 2D - Mutable 🔒 Hard (44.01%) matrix, interval, binary-indexed-tree
0309.Best Time to Buy and Sell Stock with Cooldown Medium (58.03%) dynamic-programming, best-time-to-buy-and-sell-stock cpp
0310.Minimum Height Trees Medium (38.88%) tree, graph, topological-sort cpp
0311.Sparse Matrix Multiplication 🔒 Medium (68.06%) math, matrix cpp
0312.Burst Balloons Hard (58.68%) dynamic-programming cpp
0313.Super Ugly Number Medium (45.25%) heap, math, dynamic-programming cpp
0314.Binary Tree Vertical Order Traversal 🔒 Medium (54.18%) binary-tree, breadth-first-search, depth-first-search cpp
0315.Count of Smaller Numbers After Self Hard (42.41%) sort, binary-indexed-tree, interval, merge-sort, hash-table, segment-tree cpp
0316.Remove Duplicate Letters Medium (49.58%) stack, greedy, hash-table, string cpp
0317.Shortest Distance from All Buildings 🔒 Hard (43.13%) breadth-first-search cpp
0318.Maximum Product of Word Lengths Medium (59.93%) bit-manipulation cpp
0319.Bulb Switcher Medium (52.72%) math, brainteaser cpp
0320.Generalized Abbreviation 🔒 Medium (58.36%) string, depth-first-search cpp
0321.Create Maximum Number Hard (30.01%) greedy cpp
0322.Coin Change Medium (43.81%) dynamic-programming, memoization, depth-first-search, coin-change cpp
0323.Number of Connected Components in an Undirected Graph 🔒 Medium (62.76%) graph, depth-first-search, union-find cpp
0324.Wiggle Sort II Medium (34.28%) sort, array, two-pointers, partition cpp
0325.Maximum Size Subarray Sum Equals k 🔒 Medium (49.48%) hash-table, prefix-sum cpp
0326.Power of Three Easy (46.50%) math cpp
0327.Count of Range Sum Hard (35.90%) array, interval, merge-sort, binary-indexed-tree, segment-tree, hash-table cpp
0328.Odd Even Linked List Medium (61.39%) linked-list cpp
0329.Longest Increasing Path in a Matrix Hard (53.53%) depth-first-search, breadth-first-search, memoization cpp
0330.Patching Array Hard (41.72%) greedy cpp
0331.Verify Preorder Serialization of a Binary Tree Medium (45.18%) stack cpp
0332.Reconstruct Itinerary Hard (43.24%) graph, depth-first-search, sort, stack cpp
0333.Largest BST Subtree 🔒 Medium (43.73%) binary-tree, depth-first-search cpp
0334.Increasing Triplet Subsequence Medium (40.00%) array cpp
0335.Self Crossing Hard (30.43%) math, geometry cpp
0336.Palindrome Pairs Hard (35.27%) hash-table, string, ordered-set cpp
0337.House Robber III Medium (54.23%) binary-tree, depth-first-search cpp
0338.Counting Bits Easy (78.20%) bit-manipulation, dynamic-programming cpp
0339.Nested List Weight Sum 🔒 Medium (83.47%) depth-first-search, breadth-first-search cpp
0340.Longest Substring with At Most K Distinct Characters 🔒 Medium (48.78%) string, hash-table, sliding-window cpp
0341.Flatten Nested List Iterator Medium (64.43%) design, stack, queue, depth-first-search cpp
0342.Power of Four Easy (47.94%) bit-manipulation, math cpp
0343.Integer Break Medium (60.29%) math cpp
0344.Reverse String Easy (77.76%) two-pointers, string cpp
0345.Reverse Vowels of a String Easy (52.91%) two-pointers, string cpp
0346.Moving Average from Data Stream 🔒 Easy (78.24%) queue, design cpp
0347.Top K Frequent Elements Medium (62.74%) hash-table, heap cpp
0348.Design Tic-Tac-Toe 🔒 Medium (57.93%) design, hash-table cpp
0349.Intersection of Two Arrays Easy (74.39%) hash-table, two-pointers, binary-search, sort, set cpp
0350.Intersection of Two Arrays II Easy (56.45%) hash-table, sort, two-pointers cpp
0351.Android Unlock Patterns 🔒 Medium (51.81%) depth-first-search cpp
0352.Data Stream as Disjoint Intervals Hard (59.98%) interval, ordered-map cpp
0353.Design Snake Game 🔒 Medium (38.73%) design, queue, hash-table cpp
0354.Russian Doll Envelopes Hard (37.11%) binary-search, sort, greedy cpp
0355.Design Twitter Medium (39.32%) design, hash-table, heap cpp
0356.Line Reflection 🔒 Medium (35.44%) hash-table, geometry cpp
0357.Count Numbers with Unique Digits Medium (52.86%) math, backtracking cpp
0358.Rearrange String k Distance Apart 🔒 Hard (38.62%) heap, greedy, hash-table cpp
0359.Logger Rate Limiter 🔒 Easy (75.84%) design, hash-table cpp
0360.Sort Transformed Array 🔒 Medium (55.69%) math, two-pointers cpp
0361.Bomb Enemy 🔒 Medium (51.72%) matrix cpp
0362.Design Hit Counter 🔒 Medium (68.64%) design, binary-search cpp
0363.Max Sum of Rectangle No Larger Than K Hard (44.11%) binary-search, matrix, prefix-sum, ordered-set cpp
0364.Nested List Weight Sum II 🔒 Medium (65.28%) depth-first-search cpp
0365.Water and Jug Problem Medium (40.21%) math cpp
0366.Find Leaves of Binary Tree 🔒 Medium (80.54%) binary-tree, depth-first-search cpp
0367.Valid Perfect Square Easy (43.61%) math, binary-search cpp
0368.Largest Divisible Subset Medium (45.24%) math, dynamic-programming cpp
0369.Plus One Linked List 🔒 Medium (61.02%) linked-list, recursion cpp
0370.Range Addition 🔒 Medium (71.55%) difference-array cpp
0371.Sum of Two Integers Medium (51.78%) bit-manipulation, arithmetic cpp
0372.Super Pow Medium (35.20%) math cpp
0373.Find K Pairs with Smallest Sums Medium (39.98%) heap, sort, array cpp
0374.Guess Number Higher or Lower Easy (53.39%) binary-search cpp
0375.Guess Number Higher or Lower II Medium (48.83%) dynamic-programming cpp
0376.Wiggle Subsequence Medium (48.45%) dynamic-programming, greedy cpp
0377.Combination Sum IV Medium (54.13%) dynamic-programming, array, combination cpp
0378.Kth Smallest Element in a Sorted Matrix Medium (62.38%) binary-search, matrix cpp
0379.Design Phone Directory 🔒 Medium (51.65%) design, hash-table cpp
0380.Insert Delete GetRandom O(1) Medium (54.41%) array, hash-table, design, random cpp
0381.Insert Delete GetRandom O(1) - Duplicates allowed Hard (35.44%) array, hash-table, design, random cpp
0382.Linked List Random Node Medium (63.13%) random, reservoir-sampling cpp
0383.Ransom Note Easy (61.20%) hash-table, string, easy cpp
0384.Shuffle an Array Medium (58.28%) random cpp
0385.Mini Parser Medium (38.03%) string, stack, recursion cpp
0386.Lexicographical Numbers Medium (63.77%) math, string, depth-first-search cpp
0387.First Unique Character in a String Easy (62.09%) hash-table cpp
0388.Longest Absolute File Path Medium (47.24%) stack, hash-table cpp
0389.Find the Difference Easy (59.77%) hash-table cpp
0390.Elimination Game Medium (45.70%) math cpp
0391.Perfect Rectangle Hard (33.63%) hash-table, geometry, hard cpp
0392.Is Subsequence Easy (47.93%) string, two-pointers cpp
0393.UTF-8 Validation Medium (45.11%) bit-manipulation cpp
0394.Decode String Medium (59.08%) stack, string cpp
0395.Longest Substring with At Least K Repeating Characters Medium (44.96%) string, sliding-window, hash-table cpp
0396.Rotate Function Medium (42.45%) math cpp
0397.Integer Replacement Medium (35.70%) bit-manipulation, math, recursion cpp
0398.Random Pick Index Medium (63.18%) random, hash-table, reservoir-sampling cpp
0399.Evaluate Division Medium (61.62%) union-find, graph, depth-first-search cpp
0400.Nth Digit Medium (34.75%) math cpp
0401.Binary Watch Easy (54.15%) bit-manipulation cpp
0402.Remove K Digits Medium (31.73%) stack, greedy cpp
0403.Frog Jump Hard (46.01%) binary-search, hash-table, depth-first-search, memoization cpp
0404.Sum of Left Leaves Easy (57.80%) binary-tree cpp
0405.Convert a Number to Hexadecimal Easy (48.31%) bit-manipulation cpp
0406.Queue Reconstruction by Height Medium (73.40%) sort cpp
0407.Trapping Rain Water II Hard (47.89%) heap, breadth-first-search cpp
0408.Valid Word Abbreviation 🔒 Easy (35.65%) string, two-pointers cpp
0409.Longest Palindrome Easy (53.90%) hash-table, string, palindrome cpp
0410.Split Array Largest Sum Hard (55.20%) binary-search, dynamic-programming, prefix-sum, array, target-sum cpp
0411.Minimum Unique Word Abbreviation 🔒 Hard (39.71%) heap, bit-manipulation, string cpp
0412.Fizz Buzz Easy (72.00%) easy cpp
0413.Arithmetic Slices Medium (65.04%) math, dynamic-programming cpp
0414.Third Maximum Number Easy (34.76%) array cpp
0415.Add Strings Easy (51.71%) string, arithmetic, two-pointers cpp
0416.Partition Equal Subset Sum Medium (46.25%) dynamic-programming, bit-manipulation, array, target-sum cpp
0417.Pacific Atlantic Water Flow Medium (55.15%) depth-first-search, breadth-first-search, matrix cpp
0418.Sentence Screen Fitting 🔒 Medium (36.10%) greedy cpp
0419.Battleships in a Board Medium (75.30%) matrix cpp
0420.Strong Password Checker Hard (13.60%) string, hard, heap cpp
0421.Maximum XOR of Two Numbers in an Array Medium (53.32%) bit-manipulation, trie, array cpp
0422.Valid Word Square 🔒 Easy (40.91%) matrix, string cpp
0423.Reconstruct Original Digits from English Medium (51.10%) string, math cpp
0424.Longest Repeating Character Replacement Medium (53.72%) string, sliding-window cpp
0425.Word Squares 🔒 Hard (53.30%) trie, backtracking, string cpp
0426.Convert Binary Search Tree to Sorted Doubly Linked List 🔒 Medium (64.77%) binary-tree, binary-search-tree, linked-list, recursion cpp
0427.Construct Quad Tree Medium (75.29%) matrix, depth-first-search cpp
0428.Serialize and Deserialize N-ary Tree 🔒 Hard (66.89%) tree, depth-first-search, breadth-first-search, design, serialization cpp
0429.N-ary Tree Level Order Traversal Medium (70.82%) tree, breadth-first-search, depth-first-search cpp
0430.Flatten a Multilevel Doubly Linked List Medium (60.03%) linked-list, stack, recursion cpp
0431.Encode N-ary Tree to Binary Tree 🔒 Hard (79.41%) binary-tree, tree, recursion cpp
0432.All O`one Data Structure Hard (36.73%) hash-table, design, linked-list cpp
0433.Minimum Genetic Mutation Medium (53.59%) breadth-first-search cpp
0434.Number of Segments in a String Easy (36.40%) string cpp
0435.Non-overlapping Intervals Medium (53.13%) sort, greedy, interval cpp
0436.Find Right Interval Medium (51.99%) sort, array, binary-search, interval cpp
0437.Path Sum III Medium (46.43%) binary-tree, hash-table, depth-first-search, prefix-sum cpp
0438.Find All Anagrams in a String Medium (50.86%) sliding-window, hash-table cpp
0439.Ternary Expression Parser 🔒 Medium (60.77%) stack, string cpp
0440.K-th Smallest in Lexicographical Order Hard (32.14%) tree, depth-first-search cpp
0441.Arranging Coins Easy (46.55%) math, binary-search cpp
0442.Find All Duplicates in an Array Medium (75.66%) array, duplicate cpp
0443.String Compression Medium (54.27%) two-pointers cpp
0444.Sequence Reconstruction 🔒 Medium (28.08%) graph, topological-sort cpp
0445.Add Two Numbers II Medium (61.12%) linked-list, arithmetic cpp
0446.Arithmetic Slices II - Subsequence Hard (54.58%) dynamic-programming, hash-table cpp
0447.Number of Boomerangs Medium (55.40%) hash-table, math cpp
0448.Find All Numbers Disappeared in an Array Easy (60.91%) array, hash-table cpp
0449.Serialize and Deserialize BST Medium (57.62%) binary-search-tree, binary-tree, design, monotonous-stack, serialization cpp
0450.Delete Node in a BST Medium (51.17%) binary-search-tree, binary-tree, recursion cpp
0451.Sort Characters By Frequency Medium (72.51%) hash-table, heap, sort, string, bucket-sort cpp
0452.Minimum Number of Arrows to Burst Balloons Medium (58.87%) interval, greedy, sort cpp
0453.Minimum Moves to Equal Array Elements Medium (56.69%) array, math cpp
0454.4Sum II Medium (57.23%) hash-table cpp
0455.Assign Cookies Easy (52.67%) greedy cpp
0456.132 Pattern Medium (33.75%) monotonic-stack, array cpp
0457.Circular Array Loop Medium (33.92%) fast-slow-pointers, array cpp
0458.Poor Pigs Hard (59.75%) math cpp
0459.Repeated Substring Pattern Easy (46.07%) string cpp
0460.LFU Cache Hard (44.11%) design cpp
0461.Hamming Distance Easy (75.37%) bit-manipulation cpp
0462.Minimum Moves to Equal Array Elements II Medium (60.10%) sort, partition cpp
0463.Island Perimeter Easy (70.35%) geometry cpp
0464.Can I Win Medium (29.66%) depth-first-search, memoization, minimax cpp
0465.Optimal Account Balancing 🔒 Hard (49.56%) bit-manipulation, dynamic-programming cpp
0466.Count The Repetitions Hard (30.12%) string, hard cpp
0467.Unique Substrings in Wraparound String Medium (39.56%) dynamic-programming cpp
0468.Validate IP Address Medium (26.95%) string cpp
0469.Convex Polygon 🔒 Medium (39.38%) math, geometry cpp
0470.Implement Rand10() Using Rand7() Medium (45.97%) math, random cpp
0471.Encode String with Shortest Length 🔒 Hard (50.43%) string, dynamic-programming cpp
0472.Concatenated Words Hard (49.46%) string, trie, depth-first-search cpp
0473.Matchsticks to Square Medium (40.24%) depth-first-search, dynamic-programming, bit-manipulation, backtracking cpp
0474.Ones and Zeroes Medium (47.53%) dynamic-programming, depth-first-search, memoization cpp
0475.Heaters Medium (37.73%) binary-search, sort cpp
0476.Number Complement Easy (67.60%) bit-manipulation cpp
0477.Total Hamming Distance Medium (52.55%) bit-manipulation cpp
0478.Generate Random Point in a Circle Medium (39.78%) geometry, random, math cpp
0479.Largest Palindrome Product Hard (33.18%) math, palindrome cpp
0480.Sliding Window Median Hard (39.25%) sliding-window, multiset, heap, hash-table, hard cpp
0481.Magical String Medium (51.20%) math, string cpp
0482.License Key Formatting Easy (43.72%) string cpp
0483.Smallest Good Base Hard (40.44%) math, binary-search, hard cpp
0484.Find Permutation 🔒 Medium (66.86%) string, permutation, greedy cpp
0485.Max Consecutive Ones Easy (58.89%) array cpp
0486.Predict the Winner Medium (55.45%) minimax, dynamic-programming, game-theory, depth-first-search, memoization cpp
0487.Max Consecutive Ones II 🔒 Medium (50.33%) array, sliding-window cpp
0488.Zuma Game Hard (32.92%) recursion, depth-first-search, memoization cpp
0489.Robot Room Cleaner 🔒 Hard (76.67%) depth-first-search cpp
0490.The Maze 🔒 Medium (57.78%) breadth-first-search cpp
0491.Non-decreasing Subsequences Medium (60.65%) depth-first-search, array cpp
0492.Construct the Rectangle Easy (57.37%) math, geometry cpp
0493.Reverse Pairs Hard (30.57%) array, merge-sort, binary-indexed-tree, segment-tree, hash-table cpp
0494.Target Sum Medium (46.70%) dynamic-programming, array, arithmetic cpp
0495.Teemo Attacking Easy (56.56%) array cpp
0496.Next Greater Element I Easy (72.13%) array, stack, monotonic-stack, hash-table cpp
0497.Random Point in Non-overlapping Rectangles Medium (39.95%) prefix-sum, random, binary-search cpp
0498.Diagonal Traverse Medium (60.06%) matrix cpp
0499.The Maze III 🔒 Hard (48.67%) breadth-first-search cpp
0500.Keyboard Row Easy (70.61%) hash-table cpp
0501.Find Mode in Binary Search Tree Easy (56.03%) binary-search-tree, binary-tree cpp
0502.IPO Hard (49.55%) heap, sort, greedy cpp
0503.Next Greater Element II Medium (63.78%) monotonic-stack, array cpp
0504.Base 7 Easy (49.89%) math cpp
0505.The Maze II 🔒 Medium (53.35%) breadth-first-search cpp
0506.Relative Ranks Easy (63.70%) array, sort, heap, ordered-map, hash-table cpp
0507.Perfect Number Easy (40.16%) math cpp
0508.Most Frequent Subtree Sum Medium (66.27%) binary-tree, hash-table, depth-first-search cpp
0509.Fibonacci Number Easy (70.93%) fibonacci, dynamic-programming cpp
0510.Inorder Successor in BST II 🔒 Medium (60.92%) binary-tree, binary-search-tree cpp
0513.Find Bottom Left Tree Value Medium (71.09%) binary-tree, depth-first-search, breadth-first-search cpp
0514.Freedom Trail Hard (47.72%) dynamic-programming, depth-first-search, memoization cpp
0515.Find Largest Value in Each Tree Row Medium (65.66%) binary-tree, depth-first-search, breadth-first-search cpp
0516.Longest Palindromic Subsequence Medium (62.52%) dynamic-programming, palindrome cpp
0517.Super Washing Machines Hard (41.14%) math, greedy cpp
0518.Coin Change II Medium (63.76%) dynamic-programming, coin-change cpp
0519.Random Flip Matrix Medium (41.82%) random, design, array cpp
0520.Detect Capital Easy (56.50%) string cpp
0521.Longest Uncommon Subsequence I Easy (60.69%) string cpp
0522.Longest Uncommon Subsequence II Medium (41.28%) string, sort, two-pointers cpp
0523.Continuous Subarray Sum Medium (28.87%) prefix-sum, hash-table cpp
0524.Longest Word in Dictionary through Deleting Medium (51.16%) two-pointers, sort, string cpp
0525.Contiguous Array Medium (48.93%) hash-table, array, prefix-sum cpp
0526.Beautiful Arrangement Medium (64.24%) permutation, recursion cpp
0527.Word Abbreviation 🔒 Hard (60.95%) trie, string cpp
0528.Random Pick with Weight Medium (46.73%) prefix-sum, random, binary-search cpp
0529.Minesweeper Medium (66.54%) matrix, depth-first-search, design cpp
0530.Minimum Absolute Difference in BST Easy (58.39%) binary-search-tree, binary-tree cpp
0531.Lonely Pixel I 🔒 Medium (62.26%) matrix cpp
0532.K-diff Pairs in an Array Medium (42.70%) array, hash-table cpp
0533.Lonely Pixel II 🔒 Medium (48.59%) matrix, array cpp
0535.Encode and Decode TinyURL Medium (86.33%) hash-table, design cpp
0536.Construct Binary Tree from String 🔒 Medium (56.81%) binary-tree, string, recursion cpp
0537.Complex Number Multiplication Medium (71.75%) math, string, arithmetic cpp
0538.Convert BST to Greater Tree Medium (68.94%) binary-search-tree, binary-tree, stack cpp
0539.Minimum Time Difference Medium (56.81%) string, array, sort, bitmap cpp
0540.Single Element in a Sorted Array Medium (59.01%) binary-search, bit-manipulation, duplicate cpp
0541.Reverse String II Easy (50.63%) string cpp
0542.01 Matrix Medium (48.33%) breadth-first-search, matrix, dynamic-programming cpp
0543.Diameter of Binary Tree Easy (60.21%) binary-tree, depth-first-search cpp
0544.Output Contest Matches 🔒 Medium (77.11%) array cpp
0545.Boundary of Binary Tree 🔒 Medium (45.32%) binary-tree cpp
0546.Remove Boxes Hard (47.74%) depth-first-search, memoization, hard cpp
0547.Number of Provinces Medium (66.08%) graph, union-find cpp
0548.Split Array with Equal Sum 🔒 Hard (50.11%) prefix-sum, hash-table cpp
0549.Binary Tree Longest Consecutive Sequence II 🔒 Medium (49.47%) binary-tree, depth-first-search cpp
0551.Student Attendance Record I Easy (48.72%) string, regex cpp
0552.Student Attendance Record II Hard (42.71%) depth-first-search, memoization cpp
0553.Optimal Division Medium (60.69%) math cpp
0554.Brick Wall Medium (54.72%) hash-table cpp
0555.Split Concatenated Strings 🔒 Medium (43.46%) greedy, string cpp
0556.Next Greater Element III Medium (34.02%) permutation, string cpp
0557.Reverse Words in a String III Easy (83.03%) string, stack, two-pointers cpp
0558.Logical OR of Two Binary Grids Represented as Quad-Trees Medium (49.55%) tree, depth-first-search cpp
0559.Maximum Depth of N-ary Tree Easy (72.11%) tree, depth-first-search cpp
0560.Subarray Sum Equals K Medium (43.54%) array, hash-table, prefix-sum cpp
0561.Array Partition Easy (78.71%) array, sort cpp
0562.Longest Line of Consecutive One in Matrix 🔒 Medium (50.36%) dynamic-programming, matrix cpp
0563.Binary Tree Tilt Easy (61.69%) binary-tree, depth-first-search cpp
0564.Find the Closest Palindrome Hard (22.28%) palindrome, string cpp
0565.Array Nesting Medium (56.34%) array cpp
0566.Reshape the Matrix Easy (63.08%) matrix cpp
0567.Permutation in String Medium (44.33%) sliding-window, hash-table, string cpp
0568.Maximum Vacation Days 🔒 Hard (45.57%) dynamic-programming cpp
0572.Subtree of Another Tree Easy (47.78%) binary-tree, depth-first-search cpp
0573.Squirrel Simulation 🔒 Medium (57.10%) planning, greedy cpp
0575.Distribute Candies Easy (67.58%) hash-table cpp
0576.Out of Boundary Paths Medium (48.07%) dynamic-programming, depth-first-search, memoization, matrix cpp
0581.Shortest Unsorted Continuous Subarray Medium (36.81%) array, sort, two-pointers, sliding-window cpp
0582.Kill Process 🔒 Medium (69.27%) tree, graph, depth-first-search cpp
0583.Delete Operation for Two Strings Medium (61.47%) string, dynamic-programming cpp
0587.Erect the Fence Hard (51.92%) geometry cpp
0588.Design In-Memory File System 🔒 Hard (48.14%) design, hash-table, trie cpp
0589.N-ary Tree Preorder Traversal Easy (75.46%) stack, tree cpp
0590.N-ary Tree Postorder Traversal Easy (77.84%) stack, tree cpp
0591.Tag Validator Hard (38.14%) string, stack cpp
0592.Fraction Addition and Subtraction Medium (53.15%) math, string, arithmetic, greatest-common-divisor cpp
0593.Valid Square Medium (43.99%) math, hash-table, geometry cpp
0594.Longest Harmonious Subsequence Easy (54.60%) hash-table, array, ordered-map, sliding-window, sort cpp
0598.Range Addition II Easy (56.04%) math, matrix cpp
0599.Minimum Index Sum of Two Lists Easy (55.26%) hash-table, string cpp
0600.Non-negative Integers without Consecutive Ones Hard (39.71%) math, dynamic-programming, bit-manipulation cpp
0604.Design Compressed String Iterator 🔒 Easy (39.74%) design, string cpp
0605.Can Place Flowers Easy (29.25%) array, greedy cpp
0606.Construct String from Binary Tree Medium (69.13%) binary-tree, string cpp
0609.Find Duplicate File in System Medium (67.62%) hash-table, string cpp
0611.Valid Triangle Number Medium (51.09%) binary-search, array, sort, two-pointers cpp
0616.Add Bold Tag in String 🔒 Medium (49.67%) string, trie cpp
0617.Merge Two Binary Trees Easy (78.91%) binary-tree, depth-first-search cpp
0621.Task Scheduler Medium (59.85%) array, hash-table, greedy cpp
0622.Design Circular Queue Medium (51.41%) design, queue, linked-list, array cpp
0623.Add One Row to Tree Medium (59.63%) binary-tree, depth-first-search, breadth-first-search cpp
0624.Maximum Distance in Arrays Medium (42.41%) array cpp
0625.Minimum Factorization 🔒 Medium (33.59%) greedy, math cpp
0628.Maximum Product of Three Numbers Easy (45.30%) sort, math, array, greedy cpp
0629.K Inverse Pairs Array Hard (50.04%) dynamic-programming, array, math cpp
0630.Course Schedule III Hard (40.18%) greedy, heap cpp
0631.Design Excel Sum Formula 🔒 Hard (43.69%) design, matrix cpp
0632.Smallest Range Covering Elements from K Lists Hard (62.41%) heap, hash-table, sort, sliding-window cpp
0633.Sum of Square Numbers Medium (33.97%) math, two-pointers cpp
0634.Find the Derangement of An Array 🔒 Medium (41.95%) dynamic-programming cpp
0635.Design Log Storage System 🔒 Medium (61.39%) string, design, ordered-map, binary-search cpp
0636.Exclusive Time of Functions Medium (62.44%) stack cpp
0637.Average of Levels in Binary Tree Easy (72.43%) binary-tree cpp
0638.Shopping Offers Medium (52.17%) memorization, recursion cpp
0639.Decode Ways II Hard (30.69%) dynamic-programming cpp
0640.Solve the Equation Medium (43.73%) math, string cpp
0641.Design Circular Deque Medium (56.86%) design, queue, linked-list, array cpp
0642.Design Search Autocomplete System 🔒 Hard (48.89%) trie, string, design, sort cpp
0643.Maximum Average Subarray I Easy (43.26%) array, sliding-window, prefix-sum cpp
0644.Maximum Average Subarray II 🔒 Hard (36.64%) binary-search, array, prefix-sum cpp
0645.Set Mismatch Easy (44.54%) hash-table, math, in-place cpp
0646.Maximum Length of Pair Chain Medium (59.76%) dynamic-programming, greedy, sort cpp
0647.Palindromic Substrings Medium (70.05%) string, dynamic-programming, palindrome, manacher cpp
0648.Replace Words Medium (62.82%) hash-table, trie, sort cpp
0649.Dota2 Senate Medium (47.53%) greedy, queue cpp
0650.2 Keys Keyboard Medium (54.06%) dynamic-programming, math cpp
0651.4 Keys Keyboard 🔒 Medium (56.09%) dynamic-programming cpp
0652.Find Duplicate Subtrees Medium (59.38%) binary-tree, serialization cpp
0653.Two Sum IV - Input is a BST Easy (61.20%) binary-search-tree, binary-tree, hash-table cpp
0654.Maximum Binary Tree Medium (85.32%) binary-tree, array, monotonic-stack, divide-and-conquer cpp
0655.Print Binary Tree Medium (63.42%) binary-tree cpp
0656.Coin Path 🔒 Hard (32.05%) dynamic-programming cpp
0657.Robot Return to Origin Easy (75.68%) easy cpp
0658.Find K Closest Elements Medium (47.31%) binary-search, two-pointers cpp
0659.Split Array into Consecutive Subsequences Medium (51.03%) hash-table, greedy cpp
0660.Remove 9 🔒 Hard (57.42%) math cpp
0661.Image Smoother Easy (67.23%) matrix cpp
0662.Maximum Width of Binary Tree Medium (42.95%) binary-tree cpp
0663.Equal Tree Partition 🔒 Medium (41.47%) binary-tree, depth-first-search, hash-table cpp
0664.Strange Printer Hard (54.96%) dynamic-programming, depth-first-search, memoization cpp
0665.Non-decreasing Array Medium (24.66%) array cpp
0666.Path Sum IV 🔒 Medium (60.94%) binary-tree, hash-table cpp
0667.Beautiful Arrangement II Medium (60.13%) array, greedy, math, brainteaser cpp
0668.Kth Smallest Number in Multiplication Table Hard (51.62%) matrix, binary-search cpp
0669.Trim a Binary Search Tree Medium (66.26%) binary-search-tree, binary-tree, depth-first-search cpp
0670.Maximum Swap Medium (48.58%) math, greedy cpp
0671.Second Minimum Node In a Binary Tree Easy (44.50%) binary-tree, depth-first-search cpp
0672.Bulb Switcher II Medium (50.07%) math, bit-manipulation cpp
0673.Number of Longest Increasing Subsequence Medium (47.90%) array, dynamic-programming cpp
0674.Longest Continuous Increasing Subsequence Easy (50.17%) array cpp
0675.Cut Off Trees for Golf Event Hard (34.30%) sort, breadth-first-search, heap cpp
0676.Implement Magic Dictionary Medium (57.33%) hash-table, string, trie, design, depth-first-search cpp
0677.Map Sum Pairs Medium (56.70%) trie, hash-table, design, string, ordered-map cpp
0678.Valid Parenthesis String Medium (37.87%) string, dynamic-programming, greedy cpp
0679.24 Game Hard (49.32%) depth-first-search, arithmetic cpp
0680.Valid Palindrome II Easy (40.56%) string, palindrome, two-pointers cpp
0681.Next Closest Time 🔒 Medium (46.58%) string cpp
0682.Baseball Game Easy (76.06%) stack cpp
0683.K Empty Slots 🔒 Hard (37.04%) ordered-set cpp
0684.Redundant Connection Medium (62.78%) graph, tree, union-find, breadth-first-search, depth-first-search cpp
0685.Redundant Connection II Hard (34.38%) graph, union-find, tree, hard cpp
0686.Repeated String Match Medium (34.95%) string cpp
0687.Longest Univalue Path Medium (41.41%) binary-tree, recursion cpp
0688.Knight Probability in Chessboard Medium (56.15%) dynamic-programming, depth-first-search, memoization cpp
0689.Maximum Sum of 3 Non-Overlapping Subarrays Hard (49.84%) prefix-sum, dyanmic-programming cpp
0690.Employee Importance Medium (66.72%) hash-table, depth-first-search, breadth-first-search, graph cpp
0691.Stickers to Spell Word Hard (48.29%) dynamic-programming, string, bit-manipulation cpp
0692.Top K Frequent Words Medium (57.93%) hash-table, heap, ordered-set, sort, bucket-sort cpp
0693.Binary Number with Alternating Bits Easy (62.34%) bit-manipulation cpp
0694.Number of Distinct Islands 🔒 Medium (61.19%) depth-first-search, hash-table cpp
0695.Max Area of Island Medium (71.93%) matrix, depth-first-search cpp
0696.Count Binary Substrings Easy (65.54%) string, dynamic-programming cpp
0697.Degree of an Array Easy (56.53%) array, hash-table cpp
0698.Partition to K Equal Sum Subsets Medium (38.45%) depth-first-search, backtracking, sort cpp
0699.Falling Squares Hard (44.88%) segment-tree, interval, ordered-map, hard cpp
0700.Search in a Binary Search Tree Easy (79.55%) binary-search-tree, binary-tree, recursion cpp
0701.Insert into a Binary Search Tree Medium (73.77%) binary-search-tree, binary-tree, recursion cpp
0702.Search in a Sorted Array of Unknown Size 🔒 Medium (72.07%) binary-search, array cpp
0703.Kth Largest Element in a Stream Easy (56.75%) heap, design cpp
0704.Binary Search Easy (57.39%) binary-search cpp
0705.Design HashSet Easy (66.91%) design, hash-table, array, linked-list, bit-manipulation cpp
0706.Design HashMap Easy (65.66%) design, hash-table, array, linked-list cpp
0707.Design Linked List Medium (28.15%) design, linked-list cpp
0708.Insert into a Sorted Circular Linked List 🔒 Medium (35.96%) linked-list cpp
0709.To Lower Case Easy (83.27%) string, easy cpp
0710.Random Pick with Blacklist Hard (33.42%) array, hash-table, random cpp
0711.Number of Distinct Islands II 🔒 Hard (52.92%) sort, hash-table, depth-first-search, geometry cpp
0712.Minimum ASCII Delete Sum for Two Strings Medium (65.05%) dynamic-programming, string cpp
0713.Subarray Product Less Than K Medium (51.27%) array, sliding-window cpp
0714.Best Time to Buy and Sell Stock with Transaction Fee Medium (68.44%) array, dynamic-programming, depth-first-search, memoization cpp
0715.Range Module Hard (44.17%) segment-tree, ordered-map, interval, hard, design cpp
0716.Max Stack 🔒 Hard (45.03%) design, stack, linked-list, ordered-map cpp
0717.1-bit and 2-bit Characters Easy (45.26%) array, dynamic-programming cpp
0718.Maximum Length of Repeated Subarray Medium (50.96%) array, dynamic-programming cpp
0719.Find K-th Smallest Pair Distance Hard (37.83%) sort, binary-search, two-pointers, sliding-window cpp
0720.Longest Word in Dictionary Medium (52.34%) string, trie, hash-table, sort, greedy, depth-first-search, breadth-first-search cpp
0721.Accounts Merge Medium (57.05%) breadth-first-search, union-find cpp
0722.Remove Comments Medium (38.54%) string cpp
0723.Candy Crush 🔒 Medium (76.89%) matrix, design, two-pointers cpp
0724.Find Pivot Index Easy (57.37%) prefix-sum, math, array cpp
0725.Split Linked List in Parts Medium (64.00%) linked-list cpp
0726.Number of Atoms Hard (52.76%) hash-table, stack cpp
0727.Minimum Window Subsequence 🔒 Hard (43.38%) string, dynamic-programming cpp
0728.Self Dividing Numbers Easy (78.48%) math, easy cpp
0729.My Calendar I Medium (56.55%) array, interval, ordered-map, binary-search cpp
0730.Count Different Palindromic Subsequences Hard (45.30%) string, dynamic-programming, palindrome, hard cpp
0731.My Calendar II Medium (55.35%) interval, ordered-map, difference-array, segment-tree cpp
0732.My Calendar III Hard (71.57%) interval, ordered-map, difference-array, segment-tree cpp
0733.Flood Fill Easy (63.78%) matrix, depth-first-search cpp
0734.Sentence Similarity 🔒 Easy (44.26%) array, hash-table, string cpp
0735.Asteroid Collision Medium (44.53%) stack cpp
0736.Parse Lisp Expression Hard (51.70%) string, hash-table, recursion, stack cpp
0737.Sentence Similarity II 🔒 Medium (49.87%) union-find, string, graph cpp
0738.Monotone Increasing Digits Medium (47.94%) greedy, string cpp
0739.Daily Temperatures Medium (65.98%) array, stack, monotonic-stack cpp
0740.Delete and Earn Medium (56.49%) dynamic-programming cpp
0741.Cherry Pickup Hard (36.72%) dynamic-programming, matrix, hard cpp
0742.Closest Leaf in a Binary Tree 🔒 Medium (46.17%) graph, binary-tree, breadth-first-search, depth-first-search cpp
0743.Network Delay Time Medium (53.61%) graph, dijkstra, heap, shortest-path cpp
0744.Find Smallest Letter Greater Than Target Easy (51.95%) binary-search cpp
0745.Prefix and Suffix Search Hard (41.03%) hash-table, string cpp
0746.Min Cost Climbing Stairs Easy (65.57%) dynamic-programming, memoization, depth-first-search cpp
0747.Largest Number At Least Twice of Others Easy (48.74%) array cpp
0748.Shortest Completing Word Easy (59.85%) hash-table, string cpp
0749.Contain Virus Hard (50.84%) breadth-first-search, hash-table, greedy, hard cpp
0750.Number Of Corner Rectangles 🔒 Medium (67.69%) hash-table, matrix cpp
0751.IP to CIDR 🔒 Medium (55.06%) bit-manipulation, greedy cpp
0752.Open the Lock Medium (56.02%) breadth-first-search, hash-table cpp
0753.Cracking the Safe Hard (56.75%) hash-table, graph, greedy cpp
0754.Reach a Number Medium (42.99%) math cpp
0755.Pour Water 🔒 Medium (46.79%) array cpp
0756.Pyramid Transition Matrix Medium (52.65%) depth-first-search, memoization cpp
0757.Set Intersection Size At Least Two Hard (44.35%) sort, greedy, array, interval cpp
0758.Bold Words in String 🔒 Medium (51.40%) string, trie cpp
0759.Employee Free Time 🔒 Hard (72.07%) sort, array, interval cpp
0760.Find Anagram Mappings 🔒 Easy (83.61%) array cpp
0761.Special Binary String Hard (61.02%) sort, recursion cpp
0762.Prime Number of Set Bits in Binary Representation Easy (69.32%) bit-manipulation cpp
0763.Partition Labels Medium (79.82%) string, greedy, string cpp
0764.Largest Plus Sign Medium (48.17%) matrix cpp
0765.Couples Holding Hands Hard (57.17%) union-find, greedy, graph cpp
0766.Toeplitz Matrix Easy (68.92%) matrix cpp
0767.Reorganize String Medium (54.53%) greedy, hash-table cpp
0768.Max Chunks To Make Sorted II Hard (53.18%) sort, monotonic-stack, stack, array cpp
0769.Max Chunks To Make Sorted Medium (58.36%) greedy, array cpp
0770.Basic Calculator IV Hard (55.31%) string, basic-calculator, stack, math, arithmetic cpp
0771.Jewels and Stones Easy (88.53%) hash-table cpp
0772.Basic Calculator III 🔒 Hard (50.49%) string, basic-calculator, stack, math, arithmetic cpp
0773.Sliding Puzzle Hard (64.68%) breadth-first-search, hash-table cpp
0774.Minimize Max Distance to Gas Station 🔒 Hard (52.22%) binary-search cpp
0775.Global and Local Inversions Medium (42.46%) array, sort, math cpp
0776.Split BST 🔒 Medium (82.80%) binary-search-tree, binary-tree cpp
0777.Swap Adjacent in LR String Medium (36.80%) string, two-pointers cpp
0778.Swim in Rising Water Hard (60.64%) matrix, heap, breadth-first search cpp
0779.K-th Symbol in Grammar Medium (46.44%) array, binary-tree, recursion cpp
0780.Reaching Points Hard (33.14%) array, math cpp
0781.Rabbits in Forest Medium (53.39%) hash-table, array cpp
0782.Transform to Chessboard Hard (50.90%) hard, matrix cpp
0783.Minimum Distance Between BST Nodes Easy (59.53%) binary-search-tree, binary-tree cpp
0784.Letter Case Permutation Medium (74.14%) permutation, bit-manipulation, backtracking cpp
0785.Is Graph Bipartite? Medium (55.55%) graph, breadth-first-search, depth-first-search, union-find cpp
0786.K-th Smallest Prime Fraction Medium (53.76%) binary-search, heap, two-pointers, array cpp
0787.Cheapest Flights Within K Stops Medium (39.27%) graph, bellman-ford, memoization, depth-first-search, shortest-path cpp
0788.Rotated Digits Medium (56.41%) math, dynamic-programming cpp
0789.Escape The Ghosts Medium (61.68%) geometry, math cpp
0790.Domino and Tromino Tiling Medium (50.71%) array, dynamic-programming cpp
0791.Custom Sort String Medium (70.59%) string, hash-table, sort cpp
0792.Number of Matching Subsequences Medium (51.08%) binary-search, hash-table, string cpp
0793.Preimage Size of Factorial Zeroes Function Hard (44.17%) math, binary-search cpp
0794.Valid Tic-Tac-Toe State Medium (34.76%) array cpp
0795.Number of Subarrays with Bounded Maximum Medium (53.12%) array, sliding-window, math cpp
0796.Rotate String Easy (57.94%) string, kmp cpp
0797.All Paths From Source to Target Medium (82.41%) graph, breadth-first-search, depth-first-search cpp
0798.Smallest Rotation with Highest Score Hard (51.08%) difference-array, array, math, hard cpp
0799.Champagne Tower Medium (58.10%) array cpp
0800.Similar RGB Color 🔒 Easy (67.36%) string cpp
0801.Minimum Swaps To Make Sequences Increasing Hard (39.86%) dynamic-programming, array cpp
0802.Find Eventual Safe States Medium (62.35%) depth-first-search, graph, topological-sort cpp
0803.Bricks Falling When Hit Hard (34.69%) depth-first-search, union-find, matrix, hash-table, hard cpp
0804.Unique Morse Code Words Easy (82.81%) string, hash-table, easy cpp
0805.Split Array With Same Average Hard (25.38%) math, bit-manipulation, hard cpp
0806.Number of Lines To Write String Easy (68.15%) string, easy cpp
0807.Max Increase to Keep City Skyline Medium (86.08%) geometry cpp
0808.Soup Servings Medium (54.05%) dynamic-programming, depth-first-search, memoization cpp
0809.Expressive Words Medium (46.10%) two-pointers, string cpp
0810.Chalkboard XOR Game Hard (59.13%) math, game-theory cpp
0811.Subdomain Visit Count Medium (76.13%) hash-table, string cpp
0812.Largest Triangle Area Easy (60.43%) math, geometry cpp
0813.Largest Sum of Averages Medium (53.43%) dynamic-programming, recursion, memoization, array cpp
0814.Binary Tree Pruning Medium (72.17%) binary-tree, depth-first-search cpp
0815.Bus Routes Hard (47.97%) breadth-first-search cpp
0816.Ambiguous Coordinates Medium (56.68%) string cpp
0817.Linked List Components Medium (56.84%) hash-table, linked-list cpp
0818.Race Car Hard (43.60%) math, bit-manipulation, breadth-first-search, dynamic-programming, hash-table cpp
0819.Most Common Word Easy (44.35%) hash-table, string cpp
0820.Short Encoding of Words Medium (60.44%) hash-table, string, sort cpp
0821.Shortest Distance to a Character Easy (71.51%) array cpp
0822.Card Flipping Game Medium (47.19%) hash-table, array cpp
0823.Binary Trees With Factors Medium (52.92%) math, dynamic-programming, binary-tree cpp
0824.Goat Latin Easy (68.12%) string cpp
0825.Friends Of Appropriate Ages Medium (47.35%) array, prefix-sum cpp
0826.Most Profit Assigning Work Medium (46.23%) dynamic-programming, greedy cpp
0827.Making A Large Island Hard (47.01%) matrix, union-find cpp
0828.Count Unique Characters of All Substrings of a Given String Hard (52.28%) hash-table, math, string cpp
0829.Consecutive Numbers Sum Hard (41.81%) array, math cpp
0830.Positions of Large Groups Easy (52.19%) string, two-pointers cpp
0831.Masking Personal Information Medium (48.53%) string cpp
0832.Flipping an Image Easy (81.79%) matrix, bit-manipulation cpp
0833.Find And Replace in String Medium (52.77%) string, hash-table cpp
0834.Sum of Distances in Tree Hard (59.30%) graph, tree, depth-first-search cpp
0835.Image Overlap Medium (63.65%) matrix, hash-table cpp
0836.Rectangle Overlap Easy (44.70%) geometry, math cpp
0837.New 21 Game Medium (45.01%) math, depth-first-search, memoization, hard cpp
0838.Push Dominoes Medium (57.10%) array cpp
0839.Similar String Groups Hard (54.81%) string, union-find cpp
0840.Magic Squares In Grid Medium (38.93%) matrix cpp
0841.Keys and Rooms Medium (72.86%) graph, depth-first-search, breadth-first-search cpp
0842.Split Array into Fibonacci Sequence Medium (39.02%) backtracking, string cpp
0843.Guess the Word Hard (39.45%) game cpp
0844.Backspace String Compare Easy (49.13%) stack, string, two-pointers cpp
0845.Longest Mountain in Array Medium (40.28%) array cpp
0846.Hand of Straights Medium (55.82%) ordered-map, array cpp
0847.Shortest Path Visiting All Nodes Hard (65.54%) bit-manipulation, breadth-first-search, heap, hash-table cpp
0848.Shifting Letters Medium (44.77%) prefix-sum cpp
0849.Maximize Distance to Closest Person Medium (48.05%) array cpp
0850.Rectangle Area II Hard (54.12%) line-sweep, segment-tree, hard cpp
0851.Loud and Rich Medium (59.19%) graph, depth-first-search cpp
0852.Peak Index in a Mountain Array Medium (68.45%) array, binary-search cpp
0853.Car Fleet Medium (50.88%) sort, greedy, ordered-map, heap cpp
0854.K-Similar Strings Hard (39.78%) breadth-first-search, string cpp
0855.Exam Room Medium (43.28%) ordered-set, unordered-map, sort, interval, design cpp
0856.Score of Parentheses Medium (64.21%) stack, string, parentheses cpp
0857.Minimum Cost to Hire K Workers Hard (52.89%) array, heap, greedy cpp
0858.Mirror Reflection Medium (62.68%) math, greatest-common-divisor cpp
0859.Buddy Strings Easy (33.07%) string cpp
0860.Lemonade Change Easy (53.21%) greedy cpp
0861.Score After Flipping Matrix Medium (74.92%) greedy cpp
0862.Shortest Subarray with Sum at Least K Hard (26.00%) array, prefix-sum, monotonic-queue, hard cpp
0863.All Nodes Distance K in Binary Tree Medium (64.36%) binary-tree, depth-first-search, breadth-first-search, hash-table cpp
0864.Shortest Path to Get All Keys Hard (53.77%) bit-manipulation, breadth-first-search cpp
0865.Smallest Subtree with all the Deepest Nodes Medium (70.47%) binary-tree cpp
0866.Prime Palindrome Medium (25.92%) palindrome, prime, math cpp
0867.Transpose Matrix Easy (71.29%) easy cpp
0868.Binary Gap Easy (63.26%) bit-manipulation cpp
0869.Reordered Power of 2 Medium (62.77%) math cpp
0870.Advantage Shuffle Medium (52.45%) array, sort, greedy, heap cpp
0871.Minimum Number of Refueling Stops Hard (40.03%) dynamic-programming, heap cpp
0872.Leaf-Similar Trees Easy (70.21%) binary-tree, depth-first-search cpp
0873.Length of Longest Fibonacci Subsequence Medium (48.41%) array, dynamic-programming, hash-table cpp
0874.Walking Robot Simulation Medium (39.92%) hash-table cpp
0875.Koko Eating Bananas Medium (48.91%) binary-search cpp
0876.Middle of the Linked List Easy (78.33%) linked-list, fast-slow-pointers cpp
0877.Stone Game Medium (70.54%) dynamic-programming, minmax, math cpp
0878.Nth Magical Number Hard (35.37%) math, binary-search cpp
0879.Profitable Schemes Hard (48.39%) array, dynamic-programming cpp
0880.Decoded String at Index Medium (36.42%) string cpp
0881.Boats to Save People Medium (56.62%) greedy, two-pointers cpp
0882.Reachable Nodes In Subdivided Graph Hard (50.19%) graph, dijkstra, shortest-path cpp
0883.Projection Area of 3D Shapes Easy (72.40%) geometry, math cpp
0884.Uncommon Words from Two Sentences Easy (67.19%) hash-table, string cpp
0885.Spiral Matrix III Medium (74.36%) matrix cpp
0886.Possible Bipartition Medium (50.52%) graph, union-find cpp
0887.Super Egg Drop Hard (27.62%) memoization, depth-first-search, binary-search cpp
0888.Fair Candy Swap Easy (61.58%) hash-table cpp
0889.Construct Binary Tree from Preorder and Postorder Traversal Medium (71.34%) binary-tree, hash-table, recursion cpp
0890.Find and Replace Pattern Medium (76.88%) hash-table, string cpp
0891.Sum of Subsequence Widths Hard (37.73%) math, sort cpp
0892.Surface Area of 3D Shapes Easy (65.69%) geometry cpp
0893.Groups of Special-Equivalent Strings Medium (71.59%) hash-table, string cpp
0894.All Possible Full Binary Trees Medium (82.70%) binary-tree, hash-table, recursion cpp
0895.Maximum Frequency Stack Hard (66.48%) heap, hash-table, design cpp
0896.Monotonic Array Easy (61.11%) array, easy cpp
0897.Increasing Order Search Tree Easy (78.27%) binary-tree, binary-search-tree cpp
0898.Bitwise ORs of Subarrays Medium (38.52%) array, hash-table cpp
0899.Orderly Queue Hard (65.95%) math, string cpp
0900.RLE Iterator Medium (59.46%) design, string cpp
0901.Online Stock Span Medium (65.75%) array, monotonic-stack cpp
0902.Numbers At Most N Given Digit Set Hard (42.37%) depth-first-search, memoization, digit, string, hard cpp
0903.Valid Permutations for DI Sequence Hard (57.41%) dynamic-programming, array cpp
0904.Fruit Into Baskets Medium (44.14%) hash-table, sliding-window cpp
0905.Sort Array By Parity Easy (76.22%) array, two-pointers, partition cpp
0906.Super Palindromes Hard (38.85%) palindrome, math, string cpp
0907.Sum of Subarray Minimums Medium (37.41%) array, monotonic-stack, dynamic-programming, stack, math cpp
0908.Smallest Range I Easy (69.86%) math cpp
0909.Snakes and Ladders Medium (43.81%) breadth-first-search cpp
0910.Smallest Range II Medium (36.18%) math, sort cpp
0911.Online Election Medium (51.96%) binary-search, hash-table cpp
0912.Sort an Array Medium (56.68%) sort, TODO cpp
0913.Cat and Mouse Hard (34.07%) breadth-first search, graph, queue, minimax, game-theory, hard cpp
0914.X of a Kind in a Deck of Cards Easy (30.02%) math cpp
0915.Partition Array into Disjoint Intervals Medium (48.77%) array cpp
0916.Word Subsets Medium (52.30%) hash-table, string cpp
0917.Reverse Only Letters Easy (64.33%) string, two-pointers cpp
0918.Maximum Sum Circular Subarray Medium (44.67%) dynamic-programming, array, prefix-sum cpp
0919.Complete Binary Tree Inserter Medium (65.43%) queue, array, binary-tree, design cpp
0920.Number of Music Playlists Hard (60.54%) dynamic-programming cpp
0921.Minimum Add to Make Parentheses Valid Medium (75.12%) string, parentheses, stack, greedy cpp
0922.Sort Array By Parity II Easy (70.71%) array, two-pointers cpp
0923.3Sum With Multiplicity Medium (45.40%) math, sort, two-pointers, hash-table, dynamic-programming cpp
0924.Minimize Malware Spread Hard (42.00%) breadth-first-search, union-find, graph cpp
0925.Long Pressed Name Easy (32.35%) string, two-pointers cpp
0926.Flip String to Monotone Increasing Medium (61.40%) string cpp
0927.Three Equal Parts Hard (39.75%) array, bit-manipulation, math cpp
0928.Minimize Malware Spread II Hard (43.41%) union-find, graph, breadth-first-search cpp
0929.Unique Email Addresses Easy (67.12%) string, hash-table cpp
0930.Binary Subarrays With Sum Medium (62.06%) array, prefix-sum, hash-table, sliding-window cpp
0931.Minimum Falling Path Sum Medium (64.44%) dynamic-programming cpp
0932.Beautiful Array Medium (65.65%) array, divide-and-conquer, math cpp
0933.Number of Recent Calls Easy (74.93%) queue, binary-search cpp
0934.Shortest Bridge Medium (57.68%) depth-first-search, breadth-first-search cpp
0935.Knight Dialer Medium (59.99%) math, dynamic-programming, matrix cpp
0936.Stamping The Sequence Hard (62.49%) greedy, string cpp
0937.Reorder Data in Log Files Medium (56.40%) string, sort cpp
0938.Range Sum of BST Easy (86.79%) binary-search-tree, binary-tree, depth-first-search cpp
0939.Minimum Area Rectangle Medium (53.53%) ordered-map, hash-table, sort cpp
0940.Distinct Subsequences II Hard (43.15%) dynamic-programming, string cpp
0941.Valid Mountain Array Easy (33.40%) array cpp
0942.DI String Match Easy (78.45%) two-pointers cpp
0943.Find the Shortest Superstring Hard (43.79%) string, dynamic-programming, bit-manipulation cpp
0944.Delete Columns to Make Sorted Easy (74.56%) string, easy cpp
0945.Minimum Increment to Make Array Unique Medium (52.38%) sort, greedy cpp
0946.Validate Stack Sequences Medium (69.44%) stack cpp
0947.Most Stones Removed with Same Row or Column Medium (58.83%) union-find cpp
0948.Bag of Tokens Medium (58.92%) greedy cpp
0949.Largest Time for Given Digits Medium (35.13%) easy cpp
0950.Reveal Cards In Increasing Order Medium (82.86%) sort, array, queue cpp
0951.Flip Equivalent Binary Trees Medium (66.92%) binary-tree, depth-first-search cpp
0952.Largest Component Size by Common Factor Hard (40.53%) union-find, graph, math cpp
0953.Verifying an Alien Dictionary Easy (54.92%) string, hash-table cpp
0954.Array of Doubled Pairs Medium (39.13%) sort, hash-table, ordered-map cpp
0955.Delete Columns to Make Sorted II Medium (35.13%) greedy, string cpp
0956.Tallest Billboard Hard (52.35%) dynamic-programming cpp
0957.Prison Cells After N Days Medium (38.94%) hash-table cpp
0958.Check Completeness of a Binary Tree Medium (56.78%) binary-tree, breadth-first-search cpp
0959.Regions Cut By Slashes Medium (69.33%) depth-first-search cpp
0960.Delete Columns to Make Sorted III Hard (57.82%) dynamic-programming, string cpp
0961.N-Repeated Element in Size 2N Array Easy (76.60%) hash-table, math cpp
0962.Maximum Width Ramp Medium (49.83%) array, stack, monotonic-stack cpp
0963.Minimum Area Rectangle II Medium (54.71%) math, geometry, hash-table cpp
0964.Least Operators to Express Number Hard (48.36%) hard, digit, arithmetic cpp
0965.Univalued Binary Tree Easy (70.73%) binary-tree, depth-first-search cpp
0966.Vowel Spellchecker Medium (51.37%) hash-table, string cpp
0967.Numbers With Same Consecutive Differences Medium (57.97%) recursion, math cpp
0968.Binary Tree Cameras Hard (46.59%) binary-tree, depth-first-search cpp
0969.Pancake Sorting Medium (70.60%) array, sort, greedy cpp
0970.Powerful Integers Medium (43.75%) math, hash-table cpp
0971.Flip Binary Tree To Match Preorder Traversal Medium (50.46%) binary-tree, depth-first-search cpp
0972.Equal Rational Numbers Hard (43.77%) math, string cpp
0973.K Closest Points to Origin Medium (66.27%) sort, heap cpp
0974.Subarray Sums Divisible by K Medium (53.99%) hash-table, prefix-sum, math cpp
0975.Odd Even Jump Hard (39.75%) ordered-map, depth-first-search, memoization, array cpp
0976.Largest Perimeter Triangle Easy (55.89%) array, sort, greedy cpp
0977.Squares of a Sorted Array Easy (72.82%) array, two-pointers cpp
0978.Longest Turbulent Subarray Medium (47.32%) array, dynamic-programming cpp
0979.Distribute Coins in Binary Tree Medium (72.57%) binary-tree, depth-first-search cpp
0980.Unique Paths III Hard (81.71%) depth-first-search cpp
0981.Time Based Key-Value Store Medium (49.47%) hash-table, binary-search, design, ordered-map cpp
0982.Triples with Bitwise AND Equal To Zero Hard (58.03%) array, hash-table cpp
0983.Minimum Cost For Tickets Medium (65.28%) dynamic-programming cpp
0984.String Without AAA or BBB Medium (43.82%) greedy, string, recursion cpp
0985.Sum of Even Numbers After Queries Medium (68.06%) array cpp
0986.Interval List Intersections Medium (71.56%) two-pointers, interval cpp
0987.Vertical Order Traversal of a Binary Tree Hard (47.36%) depth-first-search, sort, binary-tree cpp
0988.Smallest String Starting From Leaf Medium (51.17%) binary-tree, depth-first-search cpp
0989.Add to Array-Form of Integer Easy (45.44%) array, arithmetic cpp
0990.Satisfiability of Equality Equations Medium (50.45%) depth-first-search, union-find, graph, math cpp
0991.Broken Calculator Medium (54.36%) math, greedy, recursion cpp
0992.Subarrays with K Different Integers Hard (62.96%) sliding-window, array, hash-table cpp
0993.Cousins in Binary Tree Easy (55.89%) binary-tree, breadth-first-search, depth-first-search cpp
0994.Rotting Oranges Medium (53.97%) matrix, breadth-first-search cpp
0995.Minimum Number of K Consecutive Bit Flips Hard (51.53%) greedy, array, difference-array, bit-manipulation cpp
0996.Number of Squareful Arrays Hard (50.07%) array, permutation, recursion, sort, hash-table cpp
0997.Find the Town Judge Easy (49.79%) graph cpp
0998.Maximum Binary Tree II Medium (68.94%) binary-tree, recursion cpp
0999.Available Captures for Rook Easy (68.85%) depth-first-search, matrix cpp
1000.Minimum Cost to Merge Stones Hard (42.99%) prefix-sum, dynamic-programming, hard cpp
1001.Grid Illumination Hard (36.64%) hash-table, matrix cpp
1002.Find Common Characters Easy (68.86%) array, string, hash-table cpp
1003.Check If Word Is Valid After Substitutions Medium (59.41%) stack, string cpp
1004.Max Consecutive Ones III Medium (62.85%) sliding-window cpp
1005.Maximize Sum Of Array After K Negations Easy (51.03%) array, greedy, sort cpp
1006.Clumsy Factorial Medium (56.89%) stack, math cpp
1007.Minimum Domino Rotations For Equal Row Medium (52.20%) array, greedy cpp
1008.Construct Binary Search Tree from Preorder Traversal Medium (81.88%) binary-tree, binary-search-tree, depth-first-search cpp
1009.Complement of Base 10 Integer Easy (60.78%) bit-manipulation cpp
1010.Pairs of Songs With Total Durations Divisible by 60 Medium (52.86%) array, hash-table cpp
1011.Capacity To Ship Packages Within D Days Medium (69.29%) array, binary-search cpp
1012.Numbers With Repeated Digits Hard (42.01%) math, hash-table, digit cpp
1013.Partition Array Into Three Parts With Equal Sum Easy (41.98%) array, prefix-sum cpp
1014.Best Sightseeing Pair Medium (59.23%) array cpp
1015.Smallest Integer Divisible by K Medium (46.65%) math cpp
1016.Binary String With Substrings Representing 1 To N Medium (57.37%) bit-manipulation, math, string cpp
1017.Convert to Base -2 Medium (60.58%) math cpp
1018.Binary Prefix Divisible By 5 Easy (46.72%) math cpp
1019.Next Greater Node In Linked List Medium (60.67%) linked-list, stack, monotonic-stack cpp
1020.Number of Enclaves Medium (68.72%) depth-first-search, breadth-first-search, union-find, matrix, graph cpp
1021.Remove Outermost Parentheses Easy (82.41%) parentheses, stack, string cpp
1022.Sum of Root To Leaf Binary Numbers Easy (73.07%) binary-tree, depth-first-search cpp
1023.Camelcase Matching Medium (62.12%) string cpp
1024.Video Stitching Medium (51.33%) dynamic-programming, greedy, interval cpp
1025.Divisor Game Easy (68.61%) math, game-theory cpp
1026.Maximum Difference Between Node and Ancestor Medium (78.14%) binary-tree, depth-first-search cpp
1027.Longest Arithmetic Subsequence Medium (49.03%) dynamic-programming cpp
1028.Recover a Tree From Preorder Traversal Hard (74.19%) binary-tree, depth-first-search, string cpp
1029.Two City Scheduling Medium (66.63%) greedy cpp
1030.Matrix Cells in Distance Order Easy (70.94%) breadth-first-search, sort cpp
1031.Maximum Sum of Two Non-Overlapping Subarrays Medium (59.74%) array, prefix-sum cpp
1032.Stream of Characters Hard (51.91%) trie, design cpp
1033.Moving Stones Until Consecutive Medium (47.80%) greedy, math cpp
1034.Coloring A Border Medium (48.89%) depth-first-search, matrix cpp
1035.Uncrossed Lines Medium (62.92%) dynamic-programming cpp
1036.Escape a Large Maze Hard (34.86%) hash-table, math, matrix, breadth-first-search cpp
1037.Valid Boomerang Easy (36.95%) math, geometry cpp
1038.Binary Search Tree to Greater Sum Tree Medium (85.79%) binary-search-tree, binary-tree cpp
1039.Minimum Score Triangulation of Polygon Medium (58.71%) dynamic-programming, memoization, depth-first-search, geometry, math cpp
1040.Moving Stones Until Consecutive II Medium (56.76%) greedy, two-pointers cpp
1041.Robot Bounded In Circle Medium (55.63%) array cpp
1042.Flower Planting With No Adjacent Medium (51.18%) graph, greedy cpp
1043.Partition Array for Maximum Sum Medium (76.44%) dynamic-programming cpp
1044.Longest Duplicate Substring Hard (30.53%) string, hash-table, binary-search cpp
1046.Last Stone Weight Easy (65.31%) heap cpp
1047.Remove All Adjacent Duplicates In String Easy (69.42%) stack, string cpp
1048.Longest String Chain Medium (61.00%) hash-table, sort cpp
1049.Last Stone Weight II Medium (55.20%) dynamic-programming cpp
1051.Height Checker Easy (76.46%) sort, counting-sort, array cpp
1052.Grumpy Bookstore Owner Medium (57.08%) prefix-sum cpp
1053.Previous Permutation With One Swap Medium (49.71%) math, permutation, greedy cpp
1054.Distant Barcodes Medium (46.46%) hash-table, sort cpp
1055.Shortest Way to Form String 🔒 Medium (60.09%) string, two-pointers cpp
1056.Confusing Number 🔒 Easy (48.66%) math cpp
1057.Campus Bikes 🔒 Medium (58.58%) sort, geometry cpp
1058.Minimize Rounding Error to Meet Target 🔒 Medium (45.01%) math cpp
1059.All Paths from Source Lead to Destination 🔒 Medium (37.67%) graph, depth-first-search, memoization cpp
1060.Missing Element in Sorted Array 🔒 Medium (56.60%) array, binary-search cpp
1061.Lexicographically Smallest Equivalent String Medium (76.49%) union-find, string cpp
1062.Longest Repeating Substring 🔒 Medium (60.52%) dynamic-programming, string cpp
1063.Number of Valid Subarrays 🔒 Hard (78.41%) array, monotonic-stack cpp
1064.Fixed Point 🔒 Easy (64.14%) array, binary-search cpp
1065.Index Pairs of a String 🔒 Easy (67.25%) string, trie cpp
1066.Campus Bikes II 🔒 Medium (55.17%) dynamic-programming, geometry, math cpp
1067.Digit Count in Range 🔒 Hard (46.44%) math cpp
1071.Greatest Common Divisor of Strings Easy (51.43%) string cpp
1072.Flip Columns For Maximum Number of Equal Rows Medium (63.82%) matrix, hash-table cpp
1073.Adding Two Negabinary Numbers Medium (36.75%) arithmetic cpp
1074.Number of Submatrices That Sum to Target Hard (74.42%) hash-table, prefix-sum, matrix cpp
1078.Occurrences After Bigram Easy (63.42%) string cpp
1079.Letter Tile Possibilities Medium (76.15%) hash-table, recursion, permutation, string cpp
1080.Insufficient Nodes in Root to Leaf Paths Medium (55.30%) binary-tree, depth-first-search cpp
1086.High Five 🔒 Easy (74.55%) array, sort cpp
1091.Shortest Path in Binary Matrix Medium (47.21%) breadth-first-search, matrix cpp
1140.Stone Game II Medium (67.91%) depth-first-search, memoization, minimax, game-theory, prefix-sum cpp
1143.Longest Common Subsequence Medium (57.78%) dynamic-programming, string cpp
1201.Ugly Number III Medium (29.35%) binary-search, math cpp
1209.Remove All Adjacent Duplicates in String II Medium (57.62%) stack, string cpp
1217.Minimum Cost to Move Chips to The Same Position Easy (71.70%) math cpp
1268.Search Suggestions System Medium (65.21%) sort, trie, design cpp
1276.Number of Burgers with No Waste of Ingredients Medium (51.06%) math cpp
1277.Count Square Submatrices with All Ones Medium (75.03%) dynamic-programming, matrix cpp
1283.Find the Smallest Divisor Given a Threshold Medium (59.38%) binary-search, array cpp
1290.Convert Binary Number in a Linked List to Integer Easy (81.14%) linked-list, easy cpp
1312.Minimum Insertion Steps to Make a String Palindrome Hard (70.36%) string, dynamic-programming, depth-first-search, memoization, palindrome cpp
1332.Remove Palindromic Subsequences Easy (76.34%) string, palindrome, greedy cpp
1334.Find the City With the Smallest Number of Neighbors at a Threshold Distance Medium (59.78%) graph, dijkstra, shortest-path cpp
1340.Jump Game V Hard (63.14%) depth-first-search, memoization, array cpp
1345.Jump Game IV Hard (46.26%) hash-table, breadth-first-search, array cpp
1376.Time Needed to Inform All Employees Medium (60.01%) graph, tree, depth-first-search cpp
1411.Number of Ways to Paint N × 3 Grid Hard (63.43%) math cpp
1423.Maximum Points You Can Obtain from Cards Medium (52.47%) sliding-window, array cpp
1429.First Unique Number 🔒 Medium (53.60%) queue, hash-table, design cpp
1438.Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit Medium (49.24%) sliding-window, ordered-map cpp
1446.Consecutive Characters Easy (60.40%) string, easy cpp
1472.Design Browser History Medium (77.50%) stack, design cpp
1510. Stone Game IV Hard (59.74%) dynamic-programming, game-theory cpp
1600.Throne Inheritance Medium (64.91%) tree cpp
1658.Minimum Operations to Reduce X to Zero Medium (39.67%) array, hash-table, prefix-sum cpp
1706.Where Will the Ball Fall Medium (71.76%) dynamic-programming, depth-first-search, memoization cpp
1971.Find if Path Exists in Graph Easy (51.57%) graph, depth-first-search, breadth-first-search, union-find cpp
2296.Design a Text Editor Hard (44.05%) stack, string, design, linked-list cpp
2401.Longest Nice Subarray Medium (50.75%) bit-manipulation, sliding-window cpp
2423.Remove Letter To Equalize Frequency Easy (17.25%) hash-table, string cpp
2462.Total Cost to Hire K Workers Medium (43.19%) heap, sort, greedy, two-pointers cpp
2511.Maximum Enemy Forts That Can Be Captured Easy (38.02%) array, two-pointers cpp

Reference

About

Solution to Leetcode problems. 在此记录 Leetcode 题目的解法思路,以C++为主。

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages