If you have great ideas,
Let's talk!

blog

Leetcode 0001-1000 分组

leetcodeexport

题目分类 和答案来自

https://github.com/kamyu104/LeetCode-Solutions/blob/master/0001-1000.md#array

Solutions(现在是1-1000)

每一个topic 划分出独立界面 每一个专题轮流做

Bit manipulation

Array

String

Linked List

Stack

Queue

Binary Heap

Tree

Hash Table

Math

Sort

Two Pointers

#TitleSolutionTimeSpaceDifficultyTagNote
00153 SumC++ PythonO(n^2)O(1)MediumTwo Pointers
00163 Sum ClosestC++ PythonO(n^2)O(1)MediumTwo Pointers
00184 SumC++ PythonO(n^3)O(1)MediumTwo Pointers
0019Remove Nth Node From End of ListC++ PythonO(n)O(1)Medium
0086Partition ListC++ PythonO(n)O(1)Medium
0141Linked List CycleC++ PythonO(n)O(1)Easy
0142Linked List Cycle IIC++ PythonO(n)O(1)Medium
0143Reorder ListC++ PythonO(n)O(1)Medium
0167Two Sum II - Input array is sortedC++ PythonO(n)O(1)Medium
0209Minimum Size Subarray SumC++ PythonO(n)O(1)MediumBinary Search, Sliding Window
02593Sum SmallerC++ PythonO(n^2)O(1)Medium🔒, LintCode
0283Move ZeroesC++ PythonO(n)O(1)Easy
0287Find the Duplicate NumberC++ PythonO(n)O(1)HardBinary Search, Two Pointers
0344Reverse StringC++ PythonO(n)O(1)Easy
0345Reverse Vowels of a StringC++ PythonO(n)O(1)Easy
0349Intersection of Two ArraysC++ PythonO(m + n)O(min(m, n))EasyEPIHash, Binary Search
0350Intersection of Two Arrays IIC++ PythonO(m + n)O(1)EasyEPIHash, Binary Search
0360Sort Transformed ArrayC++ PythonO(n)O(1)Medium🔒
0424Longest Repeating Character ReplacementC++ PythonO(n)O(1)MediumSliding Window
0457Circular Array LoopC++ PythonO(n)O(1)Medium
0567Permutation in StringC++ PythonO(n)O(1)Medium
0611Valid Triangle NumberC++ PythonO(n^2)O(1)Medium
0777Swap Adjacent in LR StringC++ PythonO(n)O(1)Medium
0826Most Profit Assigning WorkC++ PythonO(mlogm + nlogn)O(n)Medium
0828Count Unique Characters of All Substrings of a Given StringC++ PythonO(n)O(1)Hard
0844Backspace String CompareC++ PythonO(m + n)O(1)Easy
0862Shortest Subarray with Sum at Least KC++ PythonO(n)O(n)HardMono Deque, Sliding Window
0876Middle of the Linked ListC++ PythonO(n)O(1)Easy
0904Fruit Into BasketsC++ PythonO(n)O(1)MediumSliding Window
0930Binary Subarrays With SumC++ PythonO(n)O(1)MediumSliding Window
0977Squares of a Sorted ArrayC++ PythonO(n)O(1)Easy
0992Subarrays with K Different IntegersC++ PythonO(n)O(k)HardTwo Pointers, Sliding Window

<b><a href="#algorithms">⬆️ Back to Top</a></b>

Recursion

#TitleSolutionTimeSpaceDifficultyTagNote
0095Unique Binary Search Trees IIC++ PythonO(4^n / n^(3/2)O(4^n / n^(3/2)Medium
0098Validate Binary Search TreeC++ PythonO(n)O(1)Medium
0100Same TreeC+ PythonO(n)O(h)Easy
0104Maximum Depth of Binary TreeC++ PythonO(n)O(h)Easy
0105Construct Binary Tree from Preorder and Inorder TraversalC++ PythonO(n)O(n)Medium
0106Construct Binary Tree from Inorder and Postorder TraversalC++ PythonO(n)O(n)Medium
0108Convert Sorted Array to Binary Search TreeC++ PythonO(n)O(logn)Medium
0109Convert Sorted List to Binary Search TreeC++ PythonO(n)O(logn)Medium
0110Balanced Binary TreePythonO(n)O(h)Easy
0111Minimum Depth of Binary TreePythonO(n)O(h)Easy
0114Flatten Binary Tree to Linked ListPythonO(n)O(h)Medium
0116Populating Next Right Pointers in Each NodePythonO(n)O(1)Medium
0124Binary Tree Maximum Path SumC++ PythonO(n)O(h)Hard
0129Sum Root to Leaf NumbersPythonO(n)O(h)Medium
0156Binary Tree Upside DownPythonO(n)O(1)Medium🔒
0241Different Ways to Add ParenthesesC++ PythonO(n * 4^n / n^(3/2))O(n * 4^n / n^(3/2))Medium
0298Binary Tree Longest Consecutive SequenceC++ PythonO(n)O(h)Medium🔒
0327Count of Range SumC++ PythonO(nlogn)O(n)Hard
0333Largest BST SubtreeC++ PythonO(n)O(h)Medium🔒
0337House Robber IIIC++ PythonO(n)O(h)Medium
0395Longest Substring with At Least K Repeating CharactersC++ PythonO(n)O(1)Medium
0404Sum of Left LeavesC++ PythonO(n)O(h)Easy
0437Path Sum IIIC++ PythonO(n)O(h)Easy
0544Output Contest MatchesC++ PythonO(n)O(n)Medium
0549Binary Tree Longest Consecutive Sequence IIC++ PythonO(n)O(h)Medium🔒
0669Trim a Binary Search TreeC++ PythonO(n)O(h)Easy
0671Second Minimum Node In a Binary TreeC++ PythonO(n)O(h)Easy
0761Special Binary StringC++ PythonO(n^2)O(n)Hard

<b><a href="#algorithms">⬆️ Back to Top</a></b>

#TitleSolutionTimeSpaceDifficultyTagNote
0004Median of Two Sorted ArraysC++ PythonO(log(min(m, n)))O(1)Hard
0033Search in Rotated Sorted ArrayC++ PythonO(logn)O(1)MediumCTCI
0034Find First and Last Position of Element in Sorted ArrayC++ PythonO(logn)O(1)Medium
0035Search Insert PositionC++ PythonO(logn)O(1)Medium
0069Sqrt(x)C++ PythonO(logn)O(1)Medium
0074Search a 2D MatrixC++ PythonO(logm + logn)O(1)Medium
0081Search in Rotated Sorted Array IIC++ PythonO(logn) ~ O(n)O(1)MediumCTCI
0153Find Minimum in Rotated Sorted ArrayC++ PythonO(logn)O(1)Medium
0154Find Minimum in Rotated Sorted Array IIC++ PythonO(logn) ~ O(n)O(1)Hard
0162Find Peak ElementC++ PythonO(logn)O(1)Medium
0222Count Complete Tree NodesC++ PythonO((logn)^2)O(1)Medium
0275H-Index IIC++ PythonO(logn)O(1)MediumBinary Search
0278First Bad VersionC++ PythonO(logn)O(1)EasyLintCode
0300Longest Increasing SubsequenceC++ PythonO(nlogn)O(n)MediumCTCI, LintCodeBinary Search, BIT, Fenwick Tree, Segment Tree, DP
0302Smallest Rectangle Enclosing Black PixelsC++ PythonO(nlogn)O(1)Hard🔒
0354Russian Doll EnvelopesC++ PythonO(nlogn)O(1)Hard
0363Max Sum of Rectangle No Larger Than KC++ PythonO(min(m, n)^2 * max(m, n) * logn(max(m, n)))O(max(m, n))Hard
0367Valid Perfect SquareC++ PythonO(logn)O(1)Medium
0374Guess Number Higher or LowerC++ PythonO(logn)O(1)Easy
0410Split Array Largest SumC++ PythonO(nlogs)O(1)Hard
0436Find Right IntervalC++ PythonO(nlogn)O(n)Medium
0475HeatersC++ PythonO((m + n) * logn)O(1)Easy
0540Single Element in a Sorted ArrayC++ PythonO(logn)O(1)Medium
0658Find K Closest ElementsC++ PythonO(logn + k)O(1)Medium
0668Kth Smallest Number in Multiplication TableC++ PythonO(m * log(m * n))O(1)Hard
0702Search in a Sorted Array of Unknown SizeC++ PythonO(logn)O(1)Medium🔒Binary Search
0704Binary SearchC++ PythonO(logn)O(1)EasyBinary Search
0710Random Pick with BlacklistC++ Pythonctor: O(b) pick: O(1)O(b)Hard
0719Find K-th Smallest Pair DistanceC++ PythonO(nlogn + nlogw)O(1)Hard
0744Find Smallest Letter Greater Than TargetC++ PythonO(logn)O(1)Easy
0774Minimize Max Distance to Gas StationC++ PythonO(nlogr)O(1)Hard
0786K-th Smallest Prime FractionC++ PythonO(nlogr)O(1)Hard
0793Preimage Size of Factorial Zeroes FunctionC++ PythonO((logn)^2)O(1)Hard
0852Peak Index in a Mountain ArrayC++ PythonO(logn)O(1)Easy
0875Koko Eating BananasC++ PythonO(nlogr)O(1)Medium
0878Nth Magical NumberC++ PythonO(logn)O(1)Hard
0894All Possible Full Binary TreesC++ PythonO(n * 4^n / n^(3/2))O(n * 4^n / n^(3/2))Medium
0911Online ElectionC++ Pythonctor: O(n) query : O(logn)O(n)Medium
0981Time Based Key-Value StoreC++ Pythonset: O(1) get : O(logn)O(n)Medium

<b><a href="#algorithms">⬆️ Back to Top</a></b>

Binary Search Tree

#TitleSolutionTimeSpaceDifficultyTagNote
0220Contains Duplicate IIIC++ PythonO(nlogk)O(k)Medium
0230Kth Smallest Element in a BSTC++ PythonO(max(h, k))O(min(h, k))Medium
0235Lowest Common Ancestor of a Binary Search TreeC++ PythonO(h)O(1)EasyEPI
0270Closest Binary Search Tree ValueC++ PythonO(h)O(1)Easy🔒
0285Inorder Successor in BSTC++ PythonO(h)O(1)Medium🔒
0352Data Stream as Disjoint IntervalsC++ PythonO(logn)O(n)Hard
0449Serialize and Deserialize BSTC++ PythonO(n)O(h)Medium
0450Delete Node in a BSTC++ PythonO(h)O(h)Medium
0530Minimum Absolute Difference in BSTC++ PythonO(n)O(h)Easy
0776Split BSTC++ PythonO(n)O(h)Medium🔒
0783Minimum Distance Between BST NodesC++ PythonO(n)O(h)Easy
0510Inorder Successor in BST IIC++ PythonO(h)O(1)Medium🔒

<b><a href="#algorithms">⬆️ Back to Top</a></b>

#TitleSolutionTimeSpaceDifficultyTagNote
0102Binary Tree Level Order TraversalC++ PythonO(n)O(n)Easy
0107Binary Tree Level Order Traversal IIC++ PythonO(n)O(n)Easy
0103Binary Tree Zigzag Level Order TraversalPythonO(n)O(n)Medium
0117Populating Next Right Pointers in Each Node IIPythonO(n)O(1)Hard
0127Word LadderC++ PythonO(b^(d/2))O(w * l)MediumCTCIBi-BFS
0130Surrounded RegionsC++ PythonO(m * n)O(m + n)Medium
0133Clone GraphPythonO(n)O(n)Medium
0207Course ScheduleC++ Python*O(V+E)*
0210Course Schedule IIC++ Python*O(V+E)*
0261Graph Valid TreeC++ Python*O(V+E)*
0269Alien DictionaryC++ PythonO(n)O(1)Hard🔒Topological Sort, BFS, DFS
0286Walls and GatesC++ PythonO(m * n)O(g)Medium🔒
0310Minimum Height TreesC++ PythonO(n)O(n)Medium
0317Shortest Distance from All BuildingsC++ PythonO(k * m * n)O(m * n)Hard🔒
0433Minimum Genetic MutationC++ PythonO(n * b)O(b)Medium
0444Sequence ReconstructionC++ PythonO(n * s)O(n)Medium🔒Topological Sort
0490The MazeC++ PythonO(max(r, c) * w)O(w)Medium
0499The Maze IIIC++ PythonO(max(r, c) * wlogw)O(w^2)Hard
0505The Maze IIC++ PythonO(max(r, c) * wlogw)O(w)Medium
054201 MatrixC++ PythonO(m * n)O(1)MediumDP
0666Path Sum IVC++ PythonO(n)O(w)Medium🔒Topological Sort
0675Cut Off Trees for Golf EventC++ PythonO(t * m * n)O(m * n)HardA* Search Algorithm
0742Closest Leaf in a Binary TreeC++ PythonO(n)O(n)Medium
0743Network Delay TimeC++ Python*O(E* logV)*
0752Open the LockC++ PythonO(k * n^k + d)O(k * n^k + d)Medium
0773Sliding PuzzleC++ PythonO((m * n) * (m * n)!)O((m * n) * (m * n)!)HardA* Search Algorithm
0787Cheapest Flights Within K StopsC++ Python*O(E* logV)*
0815Bus RoutesC++ Python*O(E+V)*
0854K-Similar StringsC++ PythonO(n * n!/(c_a!…c_z!))O(n * n!/(c_a!…c_z!))Hard
0864Shortest Path to Get All KeysC++ PythonO(k * r * c + k^3*2^k)O(k*2^k)HardDijkstra's Algorithm
0882Reachable Nodes In Subdivided GraphC++ Python*O(E* logV)*
0886Possible BipartitionC++ Python*O(V+E)*
0913Cat and MouseC++ PythonO(n^3)O(n^2)HardMiniMax, Topological Sort
0934Shortest BridgeC++ PythonO(n^2)O(n^2)MediumBFS, DFS
0967Numbers With Same Consecutive DifferencesC++ PythonO(2^n)O(2^n)Medium
0994Rotting OrangesC++ PythonO(m * n)O(m * n)Easy

<b><a href="#algorithms">⬆️ Back to Top</a></b>

#TitleSolutionTimeSpaceDifficultyTagNote
0112Path SumPythonO(n)O(h)Easy
0113Path Sum IIPythonO(n)O(h)Medium
0199Binary Tree Right Side ViewPythonO(n)O(h)Medium
0200Number of IslandsC++ PythonO(m * n)O(m * n)MediumBFS, DFS, Union Find
0236Lowest Common Ancestor of a Binary TreeC++ PythonO(n)O(h)MediumEPI
0247Strobogrammatic Number IIC++ PythonO(n * 5^(n/2))O(n)Medium🔒
0250Count Univalue SubtreesC++ PythonO(n)O(h)Medium🔒
0257Binary Tree PathsC++ PythonO(n * h)O(h)Easy
0282Expression Add OperatorsC++ PythonO(4^n)O(n)Hard
0301Remove Invalid ParenthesesC++ PythonO(C(n, c))O(c)Hard
0329Longest Increasing Path in a MatrixC++ PythonO(m * n)O(m * n)HardDFS, Topological Sort
0339Nested List Weight SumC++ PythonO(n)O(h)Easy🔒
0364Nested List Weight Sum IIC++ PythonO(n)O(h)Medium🔒
0366Find Leaves of Binary TreeC++ PythonO(n)O(h)Medium🔒
0417Pacific Atlantic Water FlowC++ PythonO(m * n)O(m * n)Medium
0440K-th Smallest in Lexicographical OrderC++ PythonO(logn)O(logn)Hard
0464Can I WinC++ PythonO(n!)O(n)Medium
0515Find Largest Value in Each Tree RowC++ PythonO(n)O(h)Medium
0547Friend CirclesC++ PythonO(n^2)O(n)MediumUnion Find
0582Kill ProcessC++ PythonO(n)O(n)Medium🔒DFS, BFS
0638Shopping OffersC++ PythonO(n * 2^n)O(n)Medium
0690Employee ImportanceC++ PythonO(n)O(h)EasyDFS, BFS
0694Number of Distinct IslandsC++ PythonO(m * n)O(m * n)Medium🔒
0695Max Area of IslandC++ PythonO(m * n)O(m * n)Easy
0711Number of Distinct Islands IIC++ PythonO((m * n) * log(m * n))O(m * n)Hard🔒Hash
0733Max Area of IslandC++ PythonO(m * n)O(m * n)Easy
0749Contain VirusC++ PythonO((m * n)^(4/3))O(m * n)HardSimulation
0753Cracking the SafeC++ PythonO(k^n)O(k^n)Hardde Bruijn sequences, Lyndon word, Rolling Hash, Backtracking, Greedy
0756Pyramid Transition MatrixC++ PythonO(a^b)O(a^b)Medium
0785Is Graph Bipartite?C++ Python*O(V+E)*
0797All Paths From Source to TargetC++ PythonO(p + r * n)O(n)Medium
0802Find Eventual Safe StatesC++ Python*O(V+E)*
0827Making A Large IslandC++ PythonO(n^2)O(n^2)Hard
0834Sum of Distances in TreeC++ PythonO(n)O(n)Hard
0841Keys and RoomsC++ PythonO(n!)O(n)Medium
0851Loud and RichC++ PythonO(q + r)O(q + r)Medium

<b><a href="#algorithms">⬆️ Back to Top</a></b>

专题1 → Backtracking

<b><a href="#algorithms">⬆️ Back to Top</a></b>

Dynamic Programming

#TitleSolutionTimeSpaceDifficultyTagNote
0010Regular Expression MatchingPythonO(m * n)O(n)Hard
0044Wildcard MatchingPythonO(m * n)O(1)HardGreedy
0053Maximum SubarrayC++ PythonO(n)O(1)Easy
0062Unique PathsPythonO(m + n)O(1)MediumCombinatorics
0063Unique Paths IIPythonO(m * n)O(m + n)Medium
0064Minimum Path SumPythonO(m * n)O(m + n)Medium
0070Climbing StairsC++ PythonO(logn)O(1)EasyMatrix Exponentiation
0072Edit DistancePythonO(m * n)O(m + n)Hard
0087Scramble StringPythonO(n^4)O(n^3)Hard
0091Decode WaysC++ PythonO(n)O(1)Medium
0096Unique Binary Search TreesPythonO(n)O(1)MediumMath
0097Interleaving StringPythonO(m * n)O(m + n)Hard
0115Distinct SubsequencesPythonO(n^2)O(n)Hard
0120TrianglePythonO(m * n)O(n)Medium
0123Best Time to Buy and Sell Stock IIIPythonO(n)O(1)Hard
0132Palindrome Partitioning IIPythonO(n^2)O(n^2)Hard
0139Word BreakC++ PythonO(n * l^2)O(n)Medium
0152Maximum Product SubarrayC++ PythonO(n)O(1)Medium
0174Dungeon GamePythonO(m * n)O(m + n)Hard
0188Best Time to Buy and Sell Stock IVC++ PythonO(n)O(n)HardQuick Select, Mono Stack
0198House RobberC++ PythonO(n)O(1)Easy
0213House Robber IIC++ PythonO(n)O(1)Medium
0221Maximal SquareC++ PythonO(n^2)O(n)MediumEPI
0256Paint HouseC++ PythonO(n)O(1)Medium🔒
0265Paint House IIC++ PythonO(n * k)O(k)Hard🔒
0276Paint FenceC++ PythonO(n)O(1)Easy🔒
0279Perfect SquaresC++ PythonO(n * sqrt(n))O(n)MediumHash
0303Range Sum Query - ImmutableC++ Pythonctor: O(n), lookup: O(1)O(n)Easy
0304Range Sum Query 2D - ImmutableC++ Pythonctor: O(m * n), lookup: O(1)O(m * n)Medium
0309Best Time to Buy and Sell Stock with CooldownC++ PythonO(n)O(1)Medium
0312Burst BalloonsC++ PythonO(n^3)O(n^2)Hard
0322Coin ChangeC++ PythonO(n * k)O(k)Medium
0351Android Unlock PatternsC++ PythonO(9^2 * 2^9)O(9 * 2^9)Medium🔒Backtracking
0357Count Numbers with Unique DigitsC++ PythonO(n)O(1)MediumBacktracking, Math
0361Bomb EnemyC++ PythonO(m * n)O(m * n)Medium🔒
0368Largest Divisible SubsetC++ PythonO(n^2)O(n)Medium
0375Guess Number Higher or Lower IIC++ PythonO(n^3)O(n^2)Medium
0377Combination Sum IVC++ PythonO(nlogn + n * t)O(t)Medium
0403Frog JumpC++ PythonO(n^2)O(n^2)Hard
0416Partition Equal Subset SumC++ PythonO(n * s)O(s)Medium
0418Sentence Screen FittingC++ PythonO(r + n * c)O(n)Medium🔒
0446Arithmetic Slices II - SubsequenceC++ PythonO(n^2)O(n * d)Hard
0465Optimal Account BalancingC++ PythonO(n * 2^n)O(2^n)Hard🔒
0466Count The RepetitionsC++ PythonO(s1 * min(s2, n1))O(s2)Hard
0467Unique Substrings in Wraparound StringC++ PythonO(n)O(1)Medium
0471Encode String with Shortest LengthC++ PythonO(n^3) on averageO(n^2)Medium🔒
0472Concatenated WordsC++ PythonO(n * l^2)O(n * l)Medium
0474Ones and ZeroesC++ PythonO(s * m * n)O(m * n)Medium
0486Predict the WinnerC++ PythonO(n^2)O(n)Medium
0494Target SumC++ PythonO(n * S)O(S)MediumDP
0509Fibonacci NumberC++ PythonO(logn)O(1)Easyvariant of Climbing StairsMatrix Exponentiation
0514Freedom TrailC++ PythonO(k) ~ O(k * r^2)O(r)Hard
0516Longest Palindromic SubsequenceC++ PythonO(n^2)O(n)Medium
0518Coin Change 2C++ PythonO(n * m)O(m)MediumDP
0546Remove BoxesC++ PythonO(n^3) ~ O(n^4)O(n^3)Hard
0552Student Attendance Record IIC++ PythonO(n)O(1)Hard
0562Longest Line of Consecutive One in MatrixC++ PythonO(m * n)O(n)Medium🔒
0568Maximum Vacation DaysC++ PythonO(n^2 * k)O(k)Hard🔒
0576Out of Boundary PathsC++ PythonO(N * m * n)O(m * n)Medium
0583Delete Operation for Two StringsC++ PythonO(m * n)O(n)Medium
0600Non-negative Integers without Consecutive OnesC++ PythonO(1)O(1)Hard
0629K Inverse Pairs ArrayC++ PythonO(n * k)O(k)Hard
0639Decode Ways IIC++ PythonO(n)O(1)Hard
06502 Keys KeyboardC++ PythonO(sqrt(n))O(1)Medium
0656Coin PathC++ PythonO(n * B)O(n)Hard🔒
0664Strange PrinterC++ PythonO(n^3)O(n^2)Hard
0673Number of Longest Increasing SubsequenceC++ PythonO(n^2)O(n)Medium
0688Knight Probability in ChessboardC++ PythonO(k * n^2)O(n^2)Medium
0689Maximum Sum of 3 Non-Overlapping SubarraysC++ PythonO(n)O(n)Hard
0691Stickers to Spell WordC++ PythonO(T * S^T)O(T * S^T)HardBacktracking, Memoization
0712Minimum ASCII Delete Sum for Two StringsC++ PythonO(m * n)O(n)Medium
0714Best Time to Buy and Sell Stock with Transaction FeeC++ PythonO(n)O(1)Medium
0727Minimum Window SubsequenceC++ PythonO(s * t)O(s)Hard🔒
0730Count Different Palindromic SubsequencesC++ PythonO(n^2)O(n)Hard
0740Delete and EarnC++ PythonO(n)O(1)Medium
0741Cherry PickupC++ PythonO(n^3)O(n^2)Hard
0746Min Cost Climbing StairsC++ PythonO(n)O(1)Easy
0750Number Of Corner RectanglesC++ PythonO(n * m^2)O(n * m)Medium
0764Largest Plus SignC++ PythonO(n^2)O(n^2)Medium
0788Rotated DigitsC++ PythonO(logn)O(logn)EasyMemoization
0790Domino and Tromino TilingC++ PythonO(logn)O(1)MediumMatrix Exponentiation
0799Champagne TowerC++ PythonO(n^2)O(n)Medium
0801Minimum Swaps To Make Sequences IncreasingC++ PythonO(n)O(1)Medium
0805Split Array With Same AverageC++ PythonO(n^4)O(n^3)Hard
0808Soup ServingsC++ PythonO(1)O(1)MediumMemoization
0813Largest Sum of AveragesC++ PythonO(k * n^2)O(n)Medium
0818Race CarC++ PythonO(nlogn)O(n)Hard
0823Binary Trees With FactorsC++ PythonO(n^2)O(n)Medium
0837New 21 GameC++ PythonO(n)O(n)Medium
0838Push DominoesC++ PythonO(n)O(n)Medium
0847Shortest Path Visiting All NodesC++ PythonO(n *2^n)O(n * 2^n)HardBFS
0877Stone GameC++ PythonO(n^2)O(n)Mediumvariant of Predict the Winner
0879Profitable SchemesC++ PythonO(n * p * g)O(p * g)Hard
0903Valid Permutations for DI SequenceC++ PythonO(n^2)O(n)Hard
0920Number of Music PlaylistsC++ PythonO(n * l)O(l)Hard
0926Flip String to Monotone IncreasingC++ PythonO(n)O(1)Medium
0931Minimum Falling Path SumC++ PythonO(n^2)O(1)Medium
0935Knight DialerC++ PythonO(logn)O(1)MediumMatrix Exponentiation
0940Distinct Subsequences IIC++ PythonO(n)O(1)Hard
0943Find the Shortest SuperstringC++ PythonO(n^2 * (l^2 + 2^n))O(n^2)Hard
0956Tallest BillboardC++ PythonO(n * 3^(n/2))O(3^(n/2))Hard
0960Delete Columns to Make Sorted IIIC++ PythonO(n * l^2)O(l)Hard
0964Least Operators to Express NumberC++ PythonO(logn / logx)O(logn)HardMath
0975Odd Even JumpC++ PythonO(nlogn)O(n)HardMono Stack, BST
0980Unique Paths IIIC++ PythonO((m * n) * 2^(m * n))O((m * n) * 2^(m * n))Hard
0983Minimum Cost For TicketsC++ PythonO(n)O(1)Medium
1000Minimum Cost to Merge StonesC++ PythonO(n^3 / k)O(n^2)Hard

<b><a href="#algorithms">⬆️ Back to Top</a></b>

Greedy

#TitleSolutionTimeSpaceDifficultyTagNote
0011Container With Most WaterC++ PythonO(n)O(1)Medium
0042Trapping Rain WaterC++ PythonO(n)O(1)HardTricky
0045Jump Game IIPythonO(n)O(1)Hard
0055Jump GameC++ PythonO(n)O(1)Medium
0122Best Time to Buy and Sell Stock IIC++ PythonO(n)O(1)Easy
0134Gas StationPythonO(n)O(1)Medium
0135CandyC++ PythonO(n)O(n)Hard
0316Remove Duplicate LettersC++ PythonO(n)O(1)HardMono Stack
0321Create Maximum NumberC++ PythonO(k * (m + n + k)) ~ O(k * (m + n + k^2))O(m + n + k^2)Hardvariant of Delete DigitsGreedy, DP
0330Patching ArrayC++ PythonO(s + logn)O(1)Hard
0376Wiggle SubsequenceC++ PythonO(n)O(1)Medium
0392Is SubsequenceC++ PythonO(n)O(1)Medium
0397Integer ReplacementC++ PythonO(n)O(1)MediumMath
0402Remove K DigitsC++ PythonO(n)O(n)MediumLintCode
0435Non-overlapping IntervalsC++ PythonO(nlogn)O(1)MediumLine Sweep
0452Minimum Number of Arrows to Burst BalloonsC++ PythonO(nlogn)O(1)Medium
0455Assign CookiesC++ PythonO(nlogn)O(1)Easy
0484Find PermutationC++ PythonO(n)O(1)Medium🔒
0621Task SchedulerC++ PythonO(n)O(1)Medium
0630Course Schedule IIIC++ PythonO(nlogn)O(k)Hard
0646Maximum Length of Pair ChainC++ PythonO(nlogn)O(1)Mediumvariant of Non-overlapping IntervalsLine Sweep
0649Dota2 SenateC++ PythonO(n)O(n)Medium
0659Split Array into Consecutive SubsequencesC++ PythonO(n)O(1)Medium
0738Monotone Increasing DigitsC++ PythonO(1)O(1)Medium
0757Set Intersection Size At Least TwoC++ PythonO(nlogn)O(n)Hard
0759Employee Free TimeC++ PythonO(m * logn)O(n)Hard🔒
0763Partition LabelsC++ PythonO(n)O(n)Medium
0767Reorganize StringC++ PythonO(n)O(1)Medium
0798Smallest Rotation with Highest ScoreC++ PythonO(n)O(1)Hard
0843Guess the WordC++ PythonO(n)O(n)HardMinMax, Math
0861Score After Flipping MatrixC++ PythonO(r * c)O(1)Medium
0870Advantage ShuffleC++ PythonO(nlogn)O(n)Medium
0881Boats to Save PeopleC++ PythonO(nlogn)O(n)Medium
0936Stamping The SequenceC++ PythonO((n - m) * m)O((n - m) * m)Hard
0948Bag of TokensC++ PythonO(nlogn)O(1)MediumTwo Pointers
0962Maximum Width RampC++ PythonO(n)O(n)MediumMono Stack
0968Binary Tree CamerasC++ PythonO(n)O(h)HardDFS
0984String Without AAA or BBBC++ PythonO(a + b)O(1)Easy
0991Broken CalculatorC++ PythonO(logn)O(1)Medium
0995Minimum Number of K Consecutive Bit FlipsC++ PythonO(n)O(1)Hard

<b><a href="#algorithms">⬆️ Back to Top</a></b>

Graph

#TitleSolutionTimeSpaceDifficultyTagNote
0332Reconstruct ItineraryC++ Python*O(V+Elog
0399Evaluate DivisionC++ PythonO(e + q)O(n)MediumFloyd-Warshall Algorithm, BFS, Union Find
0765Couples Holding HandsC++ PythonO(n)O(n)Hard
0924Minimize Malware SpreadC++ PythonO(n^2)O(n)HardUnion Find
0928Minimize Malware Spread IIC++ PythonO(n^2)O(n)HardUnion Find
0959Regions Cut By SlashesC++ PythonO(n^2)O(n^2)MediumUnion Find
0990Satisfiability of Equality EquationsC++ PythonO(n)O(1)MediumUnion Find