Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

:octocat: (Weekly Update) Python / Modern C++ Solutions of All 1745 LeetCode Problems

License

NotificationsYou must be signed in to change notification settings

pythonmjs/LeetCode-Solutions

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Language License Update Progress Travis Visitors

  • R.I.P. to my old Leetcode repository, where there were5.7k+ stars and2.2k+ forks (ever the top 3 in the field).
  • Since free questions may be even mistakenly taken down by some companies, only solutions will be post on now.
  • There are new LeetCode questions every week. I'll keep updating for full summary and better solutions.
  • For more problem solutions, you can see myLintCode,GoogleKickStart repository.
  • For more challenging problem solutions, you can also see myGoogleCodeJam,FacebookHackerCup repositories.
  • Hope you enjoy the journey of learning data structures and algorithms.
  • Notes: "🔒" means your subscription ofLeetCode premium membership is required for reading the question.

Algorithms

Database

Shell

Reference

Bit Manipulation

#TitleSolutionTimeSpaceDifficultyTagNote
0136Single NumberC++PythonO(n)O(1)Easy
0137Single Number IIC++PythonO(n)O(1)Medium
0190Reverse BitsC++PythonO(1)O(1)Easy
0191Number of 1 BitsC++PythonO(1)O(1)Easy
0201Bitwise AND of Numbers RangeC++PythonO(1)O(1)Medium
0231Power of TwoC++PythonO(1)O(1)EasyLintCode
0260Single Number IIIC++PythonO(n)O(1)Medium
0268Missing NumberC++PythonO(n)O(1)MediumLintCode
0318Maximum Product of Word LengthsC++PythonO(n) ~O(n^2)O(n)MediumBit Manipulation, Counting Sort, Pruning
0342Power of FourC++PythonO(1)O(1)Easy
0371Sum of Two IntegersC++PythonO(1)O(1)EasyLintCode
0389Find the DifferenceC++PythonO(n)O(1)Easy
0393UTF-8 ValidationC++PythonO(n)O(1)Medium
0401Binary WatchC++PythonO(1)O(1)Easy
0411Minimum Unique Word AbbreviationC++PythonO((d + n) * 2^n)O(d)Hard🔒
0421Maximum XOR of Two Numbers in an ArrayC++PythonO(n)O(n)Medium
0461Hamming DistanceC++PythonO(1)O(1)Easy
0477Total Hamming DistanceC++PythonO(n)O(1)Medium
0645Set MismatchC++PythonO(n)O(1)Easy
0693Binary Number with Alternating BitsC++PythonO(1)O(1)Easy
0762Prime Number of Set Bits in Binary RepresentationC++PythonO(1)O(1)Easy
0868Binary GapC++PythonO(1)O(1)Easy
0898Bitwise ORs of SubarraysC++PythonO(n)O(1)Medium
1310XOR Queries of a SubarrayC++PythonO(n)O(1)Medium
1318Minimum Flips to Make a OR b Equal to cC++PythonO(1)O(1)Medium
1342Number of Steps to Reduce a Number to ZeroC++PythonO(logn)O(1)Easy
1558Minimum Numbers of Function Calls to Make Target ArrayC++PythonO(nlogn)O(1)MediumGreedy
1707Maximum XOR With an Element From ArrayC++PythonO(nlogn + mlogm)O(n)HardGreedy, Trie
1720Decode XORed ArrayC++PythonO(n)O(1)Easy
1734Decode XORed PermutationC++PythonO(n)O(1)Medium


Array

#TitleSolutionTimeSpaceDifficultyTagNote
0026Remove Duplicates from Sorted ArrayC++PythonO(n)O(1)EasyTwo Pointers
0027Remove ElementC++PythonO(n)O(1)Easy
0031Next PermutationC++PythonO(n)O(1)MediumTricky
0041First Missing PositiveC++PythonO(n)O(1)HardTricky
0048Rotate ImageC++PythonO(n^2)O(1)Medium
0054Spiral MatrixC++PythonO(m * n)O(1)Medium
0059Spiral Matrix IIC++PythonO(n^2)O(1)Medium
0066Plus OneC++PythonO(n)O(1)Easy
0073Set Matrix ZeroesC++PythonO(m * n)O(1)Medium
0080Remove Duplicates from Sorted Array IIC++PythonO(n)O(1)MediumTwo Pointers
0118Pascal's TriangleC++PythonO(n^2)O(1)Easy
0119Pascal's Triangle IIC++PythonO(n^2)O(1)Easy
0121Best Time to Buy and Sell StockC++PythonO(n)O(1)Easy
0128Longest Consecutive SequenceC++PythonO(n)O(n)HardTricky
0157Read N Characters Given Read4C++PythonO(n)O(1)Easy🔒
0158Read N Characters Given Read4 II - Call multiple timesC++PythonO(n)O(1)Hard🔒
0163Missing RangesC++PythonO(n)O(1)Medium🔒
0169Majority ElementC++PythonO(n)O(1)EasyBoyer–Moore Majority Vote Algorithm
0189Rotate ArrayC++PythonO(n)O(1)Easy
0215Kth Largest Element in an ArrayC++PythonO(n) on averageO(1)MediumEPIQuick Select, Tri Partition
0228Summary RangesC++PythonO(n)O(1)Medium
0229Majority Element IIC++PythonO(n)O(1)Medium
0238Product of Array Except SelfC++PythonO(n)O(1)MediumLintCode
0240Search a 2D Matrix IIC++PythonO(m + n)O(1)MediumEPI, LintCode
0243Shortest Word DistanceC++PythonO(n)O(1)Easy🔒
0245Shortest Word Distance IIIC++PythonO(n)O(1)Medium🔒
0251Flatten 2D VectorC++PythonO(1)O(1)Medium🔒
0277Find the CelebrityC++PythonO(n)O(1)Medium🔒, EPI
0289Game of LifeC++PythonO(m * n)O(1)Medium
0293Flip GameC++PythonO(n * (c+1))O(1)Easy🔒
0296Best Meeting PointC++PythonO(m * n)O(m + n)Hard🔒
0311Sparse Matrix MultiplicationC++PythonO(m * n * l)O(m * l)Medium🔒
0334Increasing Triplet SubsequenceC++PythonO(n)O(1)Medium
0370Range AdditionC++PythonO(k + n)O(1)Medium🔒
0384Shuffle an ArrayC++PythonO(n)O(n)MediumEPI
0396Rotate FunctionC++PythonO(n)O(1)Easy
0412Fizz BuzzC++PythonO(n)O(1)Easy
0414Third Maximum NumberC++PythonO(n)O(1)Easy
0419Battleships in a BoardC++PythonO(m * n)O(1)Medium
0422Valid Word SquareC++PythonO(m * n)O(1)Easy🔒
0442Find All Duplicates in an ArrayC++PythonO(n)O(1)Medium
0448Find All Numbers Disappeared in an ArrayC++PythonO(n)O(1)Easy
0462Minimum Moves to Equal Array Elements IIC++PythonO(n) on averageO(1)MediumQuick Select
0531Lonely Pixel IC++PythonO(m * n)O(m + n)Medium🔒
0533Lonely Pixel IIC++PythonO(m * n)O(m * n)Medium🔒
0565Array NestingC++PythonO(n)O(1)Medium
0566Reshape the MatrixC++PythonO(m * n)O(m * n)Easy
0581Shortest Unsorted Continuous SubarrayC++PythonO(n)O(1)Easy
0605Can Place FlowersC++PythonO(n)O(1)Easy
0624Maximum Distance in ArraysC++PythonO(n)O(1)Easy🔒
0643Maximum Average Subarray IC++PythonO(n)O(1)EasyMath
0644Maximum Average Subarray IIC++PythonO(n)O(n)Hard🔒Math
0661Image SmootherC++PythonO(m * n)O(1)Easy
0665Non-decreasing ArrayC++PythonO(n)O(1)Easy
0667Beautiful Arrangement IIC++PythonO(n)O(1)Medium
0670Maximum SwapC++PythonO(logn)O(logn)Medium
0674Longest Continuous Increasing SubsequenceC++PythonO(n)O(1)Easy
0683K Empty SlotsC++PythonO(n)O(n)Hard
0697Degree of an ArrayC++PythonO(n)O(n)Easy
0713Subarray Product Less Than KC++PythonO(n)O(1)Medium
07171-bit and 2-bit CharactersC++PythonO(n)O(1)EasyGreedy
0723Candy CrushC++PythonO((R * C)^2)O(1)Medium
0724Find Pivot IndexC++PythonO(n)O(1)Easy
0729My Calendar IC++PythonO(nlogn)O(n)Medium
0731My Calendar IIC++PythonO(n^2)O(n)Medium
0732My Calendar IIIC++PythonO(nlogn) ~O(n^2)O(n)Hard
0747Largest Number At Least Twice of OthersC++PythonO(n)O(1)Easy
0755Pour WaterC++PythonO(v * n)O(1)Medium
0766Toeplitz MatrixC++PythonO(m * n)O(1)Easy
0768Max Chunks To Make Sorted IIC++PythonO(n)O(n)HardMono Stack
0769Max Chunks To Make SortedC++PythonO(n)O(1)Medium
0778Swim in Rising WaterC++PythonO(n^2)O(n^2)HardUnion Find
0792Number of Matching SubsequencesC++PythonO(n + w)O(k)Medium
0794Valid Tic-Tac-Toe StateC++PythonO(1)O(1)Medium
0795Number of Subarrays with Bounded MaximumC++PythonO(n)O(1)Medium
0803Bricks Falling When HitC++PythonO(r * c)O(r * c)HardUnion Find
0807Max Increase to Keep City SkylineC++PythonO(n^2)O(n)Medium
0821Shortest Distance to a CharacterC++PythonO(n)O(1)Easy
0830Positions of Large GroupsC++PythonO(n)O(1)Easy
0832Flipping an ImageC++PythonO(n^2)O(1)Easy
0835Image OverlapC++PythonO(n^4)O(n^2)Medium
0840Magic Squares In GridC++PythonO(m * n)O(1)Easy
0842Split Array into Fibonacci SequenceC++PythonO(n^3)O(n)Medium
0845Longest Mountain in ArrayC++PythonO(n)O(1)Medium
0849Maximize Distance to Closest PersonC++PythonO(n)O(1)Easy
0860Lemonade ChangeC++PythonO(n)O(1)Easy
0868Transpose MatrixC++PythonO(r * c)O(1)Easy
0885Spiral Matrix IIIC++PythonO(max(m, n)^2)O(1)Medium
0888Fair Candy SwapC++PythonO(m + n)O(m + n)Easy
0896Monotonic ArrayC++PythonO(n)O(1)Easy
0905Sort Array By ParityC++PythonO(n)O(1)Easy
0909Snakes and LaddersC++PythonO(n^2)O(n^2)Medium
0915Partition Array into Disjoint IntervalsC++PythonO(n)O(n)Medium
0918Maximum Sum Circular SubarrayC++PythonO(n)O(1)Medium
0922Sort Array By Parity IIC++PythonO(n)O(1)Easy
09233Sum With MultiplicityC++PythonO(n^2)O(n)Medium
0927Three Equal PartsC++PythonO(n)O(1)Hard
0932Beautiful ArrayC++PythonO(n)O(n)Medium
0941Valid Mountain ArrayC++PythonO(n)O(1)Easy
0945Minimum Increment to Make Array UniqueC++PythonO(nlogn)O(n)Medium
0947Most Stones Removed with Same Row or ColumnC++PythonO(n)O(n)MediumUnion Find
0949Largest Time for Given DigitsC++PythonO(1)O(1)Easy
0950Reveal Cards In Increasing OrderC++PythonO(n)O(n)Medium
0952Largest Component Size by Common FactorC++PythonO(f * n)O(p + n)HardUnion Find
0954Array of Doubled PairsC++PythonO(n + klogk)O(k)Medium
0961N-Repeated Element in Size 2N ArrayC++PythonO(n)O(1)Easy
0978Longest Turbulent SubarrayC++PythonO(n)O(1)Medium
0985Sum of Even Numbers After QueriesC++PythonO(n + q)O(1)Easy
0989Add to Array-Form of IntegerC++PythonO(n + logk)O(1)Easy
0997Find the Town JudgeC++PythonO(t + n)O(n)Easy
0999Available Captures for RookC++PythonO(1)O(1)Easy
1002Find Common CharactersC++PythonO(n * l)O(1)Easy
1007Minimum Domino Rotations For Equal RowC++PythonO(n)O(1)Medium
1013Pairs of Songs With Total Durations Divisible by 60C++PythonO(n)O(1)Easy
1014Best Sightseeing PairC++PythonO(n)O(1)Medium
1018Binary Prefix Divisible By 5C++PythonO(n)O(1)Easy
1020Partition Array Into Three Parts With Equal SumC++PythonO(n)O(1)Easy
1030Matrix Cells in Distance OrderC++PythonO(m * n)O(1)Easy
1031Maximum Sum of Two Non-Overlapping SubarraysC++PythonO(n)O(1)Medium
1051Height CheckerC++PythonO(nlogn)O(n)Easy
1052Grumpy Bookstore OwnerC++PythonO(n)O(1)Medium
1072Flip Columns For Maximum Number of Equal RowsC++PythonO(m * n)O(m * n)Medium
1074Number of Submatrices That Sum to TargetC++PythonO(m^2 * n)O(n)Hard
1085Sum of Digits in the Minimum NumberC++PythonO(n * l)O(l)Easy🔒
1089Duplicate ZerosC++PythonO(n)O(1)Easy
1093Statistics from a Large SampleC++PythonO(n)O(1)Medium
1099Two Sum Less Than KC++PythonO(nlogn)O(1)Easy🔒
1109Corporate Flight BookingsC++PythonO(n)O(1)MediumLine Sweep
1144Decrease Elements To Make Array ZigzagC++PythonO(n)O(1)Medium
1184Distance Between Bus StopsC++PythonO(n)O(1)Easy
1200Minimum Absolute DifferenceC++PythonO(nlogn)O(n)Easy
1222Queens That Can Attack the KingC++PythonO(1)O(1)Medium
1252Cells with Odd Values in a MatrixC++PythonO(n + m)O(n + m)Easy
1260Shift 2D GridC++PythonO(n)O(1)Easy
1267Count Servers that CommunicateC++PythonO(m * n)O(m + n)Medium
1275Find Winner on a Tic Tac Toe GameC++PythonO(1)O(1)Easy
1295Find Numbers with Even Number of DigitsC++PythonO(nlog(logm))O(logm)Easy
1299Replace Elements with Greatest Element on Right SideC++PythonO(n)O(1)Easy
1304Find N Unique Integers Sum up to ZeroC++PythonO(n)O(1)Easy
1313Decompress Run-Length Encoded ListC++PythonO(n)O(1)Easy
1329Sort the Matrix DiagonallyC++PythonO(m * n * log(min(m, n))O(m * n)MediumSort
1331Rank Transform of an ArrayC++PythonO(nlogn)O(n)Easy
1333Filter Restaurants by Vegan-Friendly, Price and DistanceC++PythonO(rlogr)O(r)MediumSort
1337The K Weakest Rows in a MatrixC++PythonO(m * n)O(k)EasyOrderedDict, Quick Select
1343Number of Sub-arrays of Size K and Average Greater than or Equal to ThresholdC++PythonO(n)O(1)Medium
1346Check If N and Its Double ExistC++PythonO(n)O(n)Easy
1351Count Negative Numbers in a Sorted MatrixC++PythonO(m + n)O(1)Easy
1375Bulb Switcher IIIC++PythonO(n)O(1)Medium
1380Lucky Numbers in a MatrixC++PythonO(m * n)O(m + n)Easy
1389Create Target Array in the Given OrderC++PythonO(n^2)O(1)Easy
1394Find Lucky Integer in an ArrayC++PythonO(n)O(n)Easy
1399Count Largest GroupC++PythonO(nlogn)O(n)Easy
1404Number of Steps to Reduce a Number in Binary Representation to OneC++PythonO(n)O(1)Medium
1413Minimum Value to Get Positive Step by Step SumC++PythonO(n)O(1)Easy
1426Counting ElementsC++PythonO(n)O(n)Easy🔒
1427Perform String ShiftsC++PythonO(n + l)O(1)Easy🔒
1428Leftmost Column with at Least a OneC++PythonO(m + n)O(1)Medium🔒
1431Kids With the Greatest Number of CandiesC++PythonO(n)O(1)Easy
1437Check If All 1's Are at Least Length K Places AwayC++PythonO(n)O(1)Medium
1450Number of Students Doing Homework at a Given TimeC++PythonO(n)O(1)Easy
1460Make Two Arrays Equal by Reversing Sub-arraysC++PythonO(n)O(n)Easy
1464Maximum Product of Two Elements in an ArrayC++PythonO(n)O(1)Easy
1465Maximum Area of a Piece of Cake After Horizontal and Vertical CutsC++PythonO(hlogh + wlogw)O(1)Medium
1470Shuffle the ArrayC++PythonO(n)O(1)Easy
1471The k Strongest Values in an ArrayC++PythonO(n)O(1)MediumQuick Select
1475Final Prices With a Special Discount in a ShopC++PythonO(n)O(n)EasyMono Stack
1480Running Sum of 1d ArrayC++PythonO(n)O(1)Easy
1491Average Salary Excluding the Minimum and Maximum SalaryC++PythonO(n)O(1)Easy
1502Can Make Arithmetic Progression From SequenceC++PythonO(n)O(1)Easy
1503Last Moment Before All Ants Fall Out of a PlankC++PythonO(n)O(1)Medium
1534Count Good TripletsC++PythonO(n^3)O(1)Easy
1535Find the Winner of an Array GameC++PythonO(n)O(1)Medium
1538Guess the Majority in a Hidden ArrayC++PythonO(n)O(1)Medium🔒
1550Three Consecutive OddsC++PythonO(n)O(1)Easy
1559Detect Cycles in 2D GridC++PythonO(m * n)O(m * n)HardUnion Find, BFS
1560Most Visited Sector in a Circular TrackC++PythonO(n)O(1)Easy
1562Find Latest Group of Size MC++PythonO(n)O(n)Medium
1566Detect Pattern of Length M Repeated K or More TimesC++PythonO(n)O(1)Easy
1572Matrix Diagonal SumC++PythonO(n)O(1)Easy
1574Shortest Subarray to be Removed to Make Array SortedC++PythonO(n)O(1)Medium
1582Special Positions in a Binary MatrixC++PythonO(n^2)O(n)Easy
1583Count Unhappy FriendsC++PythonO(n^2)O(n^2)Medium
1619Mean of Array After Removing Some ElementsC++PythonO(n)O(1)EasyQuick Select
1629Slowest KeyC++PythonO(n)O(1)Easy
1646Get Maximum in Generated ArrayC++PythonO(n)O(n)Easy
1652Defuse the BombC++PythonO(n)O(1)Easy
1672Richest Customer WealthC++PythonO(m * n)O(1)Easy
1700Number of Students Unable to Eat LunchC++PythonO(n)O(1)Easy
1701Average Waiting TimeC++PythonO(n)O(1)Medium
1706Where Will the Ball FallC++PythonO(m * n)O(1)Medium
1714Sum Of Special Evenly-Spaced Elements In ArrayC++PythonO(n * sqrt(n))O(n * sqrt(n))Hard🔒
1726Tuple with Same ProductC++PythonO(n^2)O(n^2)Medium
1732Find the Highest AltitudeC++PythonO(n)O(1)Medium
1738Find Kth Largest XOR Coordinate ValueC++PythonO(m * n) on averageO(m * n)MediumQuick Select
1742Maximum Number of Balls in a BoxC++PythonO(nlogm)O(logm)Easy


String

#TitleSolutionTimeSpaceDifficultyTagNote
0005Longest Palindromic SubstringC++PythonO(n)O(n)MediumManacher's Algorithm
0006ZigZag ConversionC++PythonO(n)O(1)Easy
0008String to Integer (atoi)C++PythonO(n)O(1)Easy
0014Longest Common PrefixC++PythonO(n * k)O(1)Easy
0028Implement strStr()C++PythonO(n + k)O(k)EasyKMP Algorithm
0038Count and SayC++PythonO(n * 2^n)O(2^n)Easy
0043Multiply StringsC++PythonO(m * n)O(m + n)Medium
0058Length of Last WordC++PythonO(n)O(1)Easy
0067Add BinaryC++PythonO(n)O(1)Easy
0068Text JustificationC++PythonO(n)O(1)Hard
0125Valid PalindromeC++PythonO(n)O(1)Easy
0151Reverse Words in a StringC++PythonO(n)O(1)Medium
0161One Edit DistanceC++PythonO(m + n)O(1)Medium🔒
0165Compare Version NumbersC++PythonO(n)O(1)Easy
0186Reverse Words in a String IIC++PythonO(n)O(1)Medium🔒
0214Shortest PalindromeC++PythonO(n)O(n)HardKMP Algorithm,Manacher's Algorithm
0242Valid AnagramC++PythonO(n)O(1)EasyLintCode
0271Encode and Decode StringsC++PythonO(n)O(1)Medium🔒
0273Integer to English WordsC++PythonO(1)O(1)Hard
0306Addictive NumberC++PythonO(n^3)O(n)Medium
0383Ransom NoteC++PythonO(n)O(1)EasyEPI
0405Convert a Number to HexadecimalC++PythonO(n)O(1)Easy
0408Valid Word AbbreviationC++PythonO(n)O(1)Easy🔒
0415Add StringsC++PythonO(n)O(1)Easy
0420Strong Password CheckerC++PythonO(n)O(1)Hard
0434Number of Segments in a StringC++PythonO(n)O(1)Easy
0443String CompressionC++PythonO(n)O(1)Easy
0459Repeated Substring PatternC++PythonO(n)O(n)EasyKMP Algorithm
0468Validate IP AddressC++PythonO(1)O(1)Medium
0482License Key FormattingC++PythonO(n)O(1)Easy
0520Detect CapitalC++PythonO(l)O(1)Easy
0521Longest Uncommon Subsequence IC++PythonO(min(a, b))O(1)Easy
0522Longest Uncommon Subsequence IIC++PythonO(l * n^2)O(1)MediumSort
0524Longest Word in Dictionary through DeletingC++PythonO((d * l) * logd)O(1)MediumSort
0527Word AbbreviationC++PythonO(n * l) ~O(n^2 * l^2)O(n * l)Hard🔒
0539Minimum Time DifferenceC++PythonO(nlogn)O(n)Medium
0541Reverse String IIC++PythonO(n)O(1)Easy
0551Student Attendance Record IC++PythonO(n)O(1)Easy
0556Next Greater Element IIIC++PythonO(1)O(1)Medium
0557Reverse Words in a String IIIC++PythonO(n)O(1)Easy
0564Find the Closest PalindromeC++PythonO(l)O(l)Hard
0591Tag ValidatorC++PythonO(n)O(n)Hard
0616Add Bold Tag in StringC++PythonO(n * d * l)O(n)Medium🔒
0647Palindromic SubstringsC++PythonO(n)O(n)MediumManacher's Algorithm
0648Replace WordsC++PythonO(n)O(t)MediumTrie
0657Robot Return to OriginC++PythonO(n)O(1)Easy
0678Valid Parenthesis StringC++PythonO(n)O(1)Medium
0680Valid Palindrome IIC++PythonO(n)O(1)Easy
0681Next Closest TimeC++PythonO(1)O(1)Medium
0686Repeated String MatchC++PythonO(n + m)O(1)EasyRabin-Karp Algorithm
0696Count Binary SubstringsC++PythonO(n)O(1)Easy
0720Longest Word in DictionaryC++PythonO(n)O(t)EasyTrie
0722Remove CommentsC++PythonO(n)O(k)Medium
0751IP to CIDRC++PythonO(n)O(1)Medium
0758Bold Words in StringC++PythonO(n * l)O(t)Easy🔒, variant ofAdd Bold Tag in String
0791Custom Sort StringC++PythonO(n)O(1)Medium
0796Rotate StringC++PythonO(n)O(1)EasyKMP AlgorithmRabin-Karp Algorithm
0804Unique Morse Code WordsC++PythonO(n)O(n)Easy
0806Number of Lines To Write StringC++PythonO(n)O(1)Easy
0809Expressive WordsC++PythonO(n + s)O(l + s)Medium
0816Ambiguous CoordinatesC++PythonO(n^4)O(n)Medium
0819Most Common WordC++PythonO(m + n)O(m + n)Easy
0820Short Encoding of WordsC++PythonO(n)O(t)MediumTrie
0824Goat LatinC++PythonO(n + w^2)O(l)Easy
0831Masking Personal InformationC++PythonO(1)O(1)Medium
0833Find And Replace in StringC++PythonO(n + m)O(n)Medium
0839Similar String GroupsC++PythonO(n^2 * l)O(n)HardUnion Find
0848Shifting LettersC++PythonO(n)O(1)Medium
0859Buddy StringsC++PythonO(n)O(1)Easy
0880Decoded String at IndexC++PythonO(n)O(1)Medium
0884Uncommon Words from Two SentencesC++PythonO(m + n)O(m + n)Easy
0890Find and Replace PatternC++PythonO(n * l)O(1)Medium
0893Groups of Special-Equivalent StringsC++PythonO(n * l)O(n)Easy
0916Word SubsetsC++PythonO(m + n)O(1)Medium
0917Reverse Only LettersC++PythonO(n)O(1)Easy
0925Long Pressed NameC++PythonO(n)O(1)Easy
0929Unique Email AddressesC++PythonO(n * l)O(n * l)Easy
0939Minimum Area RectangleC++PythonO(n^1.5) on averageO(n)Medium
0942DI String MatchC++PythonO(n)O(1)Easy
0944Delete Columns to Make SortedC++PythonO(n * l)O(1)Medium
0953Verifying an Alien DictionaryC++PythonO(n * l)O(1)Easy
0955Delete Columns to Make Sorted IIC++PythonO(n * l)O(n)Medium
1016Binary String With Substrings Representing 1 To NC++PythonO(n^2)O(1)Medium
1023Camelcase MatchingC++PythonO(n * l)O(1)Medium
1061Lexicographically Smallest Equivalent StringC++PythonO(n)O(n)Medium🔒Union Find
1056Confusing NumberC++PythonO(logn)O(logn)Easy🔒
1071Greatest Common Divisor of StringsC++PythonO(m + n)O(1)Easy
1078Occurrences After BigramC++PythonO(n)O(1)Easy
1100Find K-Length Substrings With No Repeated CharactersC++PythonO(n)O(k)Medium🔒
1108Defanging an IP AddressC++PythonO(n)O(1)Easy
1119Remove Vowels from a StringC++PythonO(n)O(1)Easy🔒
1147Longest Chunked Palindrome DecompositionC++PythonO(n)O(1)HardRabin-Karp Algorithm
1177Can Make Palindrome from SubstringC++PythonO(m + n)O(n)Medium
1178Number of Valid Words for Each PuzzleC++PythonO(n * l + m * L)O(L!)HardTrie, Bit Manipulation
1189Maximum Number of BalloonsC++PythonO(n)O(1)EasyHash
1233Remove Sub-Folders from the FilesystemC++PythonO(n)O(t)MediumTrie
1271HexspeakC++PythonO(n)O(1)Easy
1309Decrypt String from Alphabet to Integer MappingC++PythonO(n)O(1)Easy
1324Print Words VerticallyC++PythonO(n)O(n)Medium
1328Break a PalindromeC++PythonO(n)O(1)Medium
1332Remove Palindromic SubsequencesC++PythonO(n)O(1)Easy
1347Minimum Number of Steps to Make Two Strings AnagramC++PythonO(n)O(1)Medium
1370Increasing Decreasing StringC++PythonO(n)O(1)EasySort
1371Find the Longest Substring Containing Vowels in Even CountsC++PythonO(n)O(1)Medium
1374Generate a String With Characters That Have Odd CountC++PythonO(n)O(1)Easy
1392Longest Happy PrefixC++PythonO(n)O(n)HardKMP AlgorithmRabin-Karp Algorithm
1408String Matching in an ArrayC++PythonO(n)O(t)EasyKMP Algorithm,Aho-Corasick Automata, Trie
1410HTML Entity ParserC++PythonO(n)O(t)MediumAho-Corasick Automata, Trie
1417Reformat The StringC++PythonO(n)O(1)Easy
1422Maximum Score After Splitting a StringC++PythonO(n)O(1)Easy
1432Max Difference You Can Get From Changing an IntegerC++PythonO(logn)O(logn)Medium
1436Destination CityC++PythonO(n)O(n)Easy
1446Consecutive CharactersC++PythonO(n)O(1)Easy
1455Check If a Word Occurs As a Prefix of Any Word in a SentenceC++PythonO(n)O(n)EasyKMP Algorithm
1461Check If a String Contains All Binary Codes of Size KC++PythonO(n * k)O(k * 2^k)MediumBit Manipulation
1496Path CrossingC++PythonO(n)O(n)Easy
1507Reformat DateC++PythonO(n)O(1)Easy
1528Shuffle StringC++PythonO(n)O(1)Easy
1529Bulb Switcher IVC++PythonO(n)O(1)Medium
1540Can Convert String in K MovesC++PythonO(n)O(1)Medium
1542Find Longest Awesome SubstringC++PythonO(n)O(1)Hard
1544Make The String GreatC++PythonO(n)O(1)Easy
1545Find Kth Bit in Nth Binary StringC++PythonO(n)O(1)Medium
1554Strings Differ by One CharacterC++PythonO(n * m)O(n)MediumRabin-Karp Algorithm
1556Thousand SeparatorC++PythonO(n)O(1)Easy
1573Number of Ways to Split a StringC++PythonO(n)O(1)Medium
1576Replace All ?'s to Avoid Consecutive Repeating CharactersC++PythonO(n)O(1)Easy
1592Rearrange Spaces Between WordsC++PythonO(n)O(1)EasyInplace
1598Crawler Log FolderC++PythonO(n)O(1)Easy
1614Maximum Nesting Depth of the ParenthesesC++PythonO(n)O(1)Easy
1624Largest Substring Between Two Equal CharactersC++PythonO(n)O(1)Easy
1638Count Substrings That Differ by One CharacterC++PythonO(m * n)O(1)Mediumvariant ofCount Unique Characters of All Substrings of a Given StringTricky
1662Check If Two String Arrays are EquivalentC++PythonO(n)O(1)Easy
1668Maximum Repeating SubstringC++PythonO(n)O(m)EasyKMP Algorithm
1678Goal Parser InterpretationC++PythonO(n)O(1)Easy
1684Count the Number of Consistent StringsC++PythonO(n)O(1)Easy
1694Reformat Phone NumberC++PythonO(n)O(1)EasyInplace
1698Number of Distinct Substrings in a StringC++PythonO(n^2)O(t)Medium🔒Trie
1704Determine if String Halves Are AlikeC++PythonO(n)O(1)Easy


Linked List

#TitleSolutionTimeSpaceDifficultyTagNote
0002Add Two NumbersC++PythonO(n)O(1)Medium
0021Merge Two Sorted ListsC++PythonO(n)O(1)Easy
0023Merge k Sorted ListsC++PythonO(nlogk)O(1)HardHeap, Divide and Conquer
0024Swap Nodes in PairsC++PythonO(n)O(1)Easy
0025Reverse Nodes in k-GroupC++PythonO(n)O(1)Hard
0061Rotate ListC++PythonO(n)O(1)Medium
0082Remove Duplicates from Sorted List IIC++PythonO(n)O(1)Medium
0083Remove Duplicates from Sorted ListC++PythonO(n)O(1)Easy
0092Reverse Linked List IIC++PythonO(n)O(1)Medium
0138Copy List with Random PointerC++PythonO(n)O(1)Medium
0160Intersection of Two Linked ListsC++PythonO(m + n)O(1)Easy
0203Remove Linked List ElementsC++PythonO(n)O(1)Easy
0206Reverse Linked ListC++PythonO(n)O(1)Easy
0234Palindrome Linked ListC++PythonO(n)O(1)Easy
0237Delete Node in a Linked ListC++PythonO(1)O(1)EasyLintCode
0328Odd Even Linked ListC++PythonO(n)O(1)Medium
0369Plus One Linked ListC++PythonO(n)O(1)Medium🔒Two Pointers
0445Add Two Numbers IIC++PythonO(m + n)O(m + n)Medium
0725Split Linked List in PartsC++PythonO(n + k)O(1)Medium
0817Linked List ComponentsC++PythonO(m + n)O(m)Medium
0986Interval List IntersectionsC++PythonO(m + n)O(1)Medium
1171Remove Zero Sum Consecutive Nodes from Linked ListC++PythonO(n)O(n)MediumOrderedDict, Hash
1180Count Substrings with Only One Distinct LetterC++PythonO(n)O(1)Easy🔒
1181Before and After PuzzleC++PythonO(l * rlogr)O(l * (n + r))Medium🔒Hash
1265Print Immutable Linked List in ReverseC++PythonO(n)O(sqrt(n))Medium🔒
1290Convert Binary Number in a Linked List to IntegerC++PythonO(n)O(1)Easy
1474Delete N Nodes After M Nodes of a Linked ListC++PythonO(n)O(1)Easy🔒
1634Add Two Polynomials Represented as Linked ListsC++PythonO(m + n)O(1)Medium🔒
1650Lowest Common Ancestor of a Binary Tree IIIC++PythonO(h)O(1)Medium🔒, variant ofIntersection of Two Linked Lists
1669Merge In Between Linked ListsC++PythonO(m + n)O(1)Medium
1721Swapping Nodes in a Linked ListC++PythonO(n)O(1)Medium


Stack

#TitleSolutionTimeSpaceDifficultyTagNote
0020Valid ParenthesesC++PythonO(n)O(n)Easy
0032Longest Valid ParenthesesC++PythonO(n)O(1)Hard
0071Simplify PathC++PythonO(n)O(n)Medium
0084Largest Rectangle in HistogramC++PythonO(n)O(n)HardMono Stack, DP
0085Maximal RectangleC++PythonO(m * n)O(n)HardEPIMono Stack
0101Symmetric TreeC++PythonO(n)O(h)Easy
0150Evaluate Reverse Polish NotationC++PythonO(n)O(n)Medium
0155Min StackC++PythonO(n)O(1)Easy
0224Basic CalculatorC++PythonO(n)O(n)Hard
0227Basic Calculator IIC++PythonO(n)O(n)Medium
0232Implement Queue using StacksC++PythonO(1), amortizedO(n)EasyEPI, LintCode
0255Verify Preorder Sequence in Binary Search TreeC++PythonO(n)O(1)Medium🔒
0272Closest Binary Search Tree Value IIC++PythonO(h + k)O(h)Hard🔒
0331Verify Preorder Serialization of a Binary TreeC++PythonO(n)O(1)Medium
0341Flatten Nested List IteratorC++PythonO(n)O(h)Medium🔒Iterator
0385Mini ParserC++PythonO(n)O(h)Medium
0394Decode StringC++PythonO(n)O(n)Medium
0439Ternary Expression ParserC++PythonO(n)O(1)Medium🔒
0456132 PatternC++PythonO(n)O(n)Medium
0636Exclusive Time of FunctionsC++PythonO(n)O(n)Medium
0682Baseball GameC++PythonO(n)O(n)Easy
0726Number of AtomsC++PythonO(n)O(n)Hard
0735Asteroid CollisionC++PythonO(n)O(n)Medium
0736Parse Lisp ExpressionC++PythonO(n^2)O(n^2)Hard
0739Daily TemperaturesC++PythonO(n)O(n)Medium
0770Basic Calculator IVC++Pythonadd:O(d * t)
sub:O(d * t)
mul:O(d * t^2)
eval:O(d * t)
to_list:O(d * tlogt)
O(e + d * t)Hard
0772Basic Calculator IIIC++PythonO(n)O(n)Hard
0853Car FleetC++PythonO(nlogn)O(n)Medium
0856Score of ParenthesesC++PythonO(n)O(1)Medium
0872Leaf-Similar TreesC++PythonO(n)O(h)Easy
0895Maximum Frequency StackC++PythonO(1)O(n)HardHash
0901Online Stock SpanC++PythonO(n)O(n)Medium
0921Minimum Add to Make Parentheses ValidC++PythonO(n)O(1)Medium
0946Validate Stack SequencesC++PythonO(n)O(n)Medium
1003Check If Word Is Valid After SubstitutionsC++PythonO(n)O(n)Medium
1019Next Greater Node In Linked ListC++PythonO(n)O(n)MediumMono Stack
1021Remove Outermost ParenthesesC++PythonO(n)O(1)Easy
1047Remove All Adjacent Duplicates In StringC++PythonO(n)O(n)Easy
1063Number of Valid SubarraysC++PythonO(n)O(n)Hard🔒Mono Stack
1130Minimum Cost Tree From Leaf ValuesC++PythonO(n)O(n)MediumMono Stack
1190Reverse Substrings Between Each Pair of ParenthesesC++PythonO(n)O(n)Medium
1209Remove All Adjacent Duplicates in String IIC++PythonO(n)O(n)Medium
1441Build an Array With Stack OperationsC++PythonO(n)O(1)Easy
1541Minimum Insertions to Balance a Parentheses StringC++PythonO(n)O(1)Medium
1597Build Binary Expression Tree From Infix ExpressionC++PythonO(n)O(n)Medium🔒, variant ofBasic Calculator III


Queue

#TitleSolutionTimeSpaceDifficultyTagNote
0239Sliding Window MaximumC++PythonO(n)O(k)HardEPI, LintCodeMono Deque
0281Zigzag IteratorC++PythonO(n)O(k)Medium🔒
0346Moving Average from Data StreamC++PythonO(1)O(w)Easy🔒
0933Number of Recent CallsC++PythonO(1) on averageO(w)Easy
1424Diagonal Traverse IIC++PythonO(m * n)O(m)Medium
1438Longest Continuous Subarray With Absolute Diff Less Than or Equal to LimitC++PythonO(n)O(n)HardMono Deque
1499Max Value of EquationC++PythonO(n)O(n)HardMono Deque
1696Jump Game VIC++PythonO(n)O(k)MediumMono Deque, Sliding Window


Binary Heap

#TitleSolutionTimeSpaceDifficultyTagNote
0264Ugly Number IIC++PythonO(n)O(1)MediumCTCI, LintCodeBST, Heap
0295Find Median from Data StreamC++PythonO(nlogn)O(n)HardEPI, LintCodeBST, Heap
0313Super Ugly NumberC++PythonO(n * k)O(n + k)MediumBST, Heap
0358Rearrange String k Distance ApartC++PythonO(n)O(n)Hard🔒Greedy, Heap
0373Find K Pairs with Smallest SumsC++PythonO(k * log(min(n, m, k)))O(min(n, m, k))Medium
0378Kth Smallest Element in a Sorted MatrixC++PythonO(k * log(min(n, m, k)))O(min(n, m, k))MediumLintCode
0407Trapping Rain Water IIC++PythonO(m * n * (logm + logn))O(m * n)HardLintCode
0632Smallest RangeC++PythonO(nlogk)O(k)Hard
0703Kth Largest Element in a StreamC++PythonO(nlogk)O(k)Easy
0846Hand of StraightsC++PythonO(nlogn)O(n)Medium
0855Exam RoomC++Pythonseat:O(logn)
leave:O(logn)
O(n)MediumBST, Hash
0857Minimum Cost to Hire K WorkersC++PythonO(nlogn)O(n)HardSort
0871Minimum Number of Refueling StopsC++PythonO(nlogn)O(n)HardSort
1046Last Stone WeightC++PythonO(nlogn)O(n)Easy
1057Campus BikesC++PythonO((w * b) * log(w * b))O(w * b)Medium🔒
1383Maximum Performance of a TeamC++PythonO(nlogn)O(n)Hardvariant ofMinimum Cost to Hire K WorkersSort
1439Find the Kth Smallest Sum of a Matrix With Sorted RowsC++PythonO(m * klogk)O(k)HardBinary Search
1606Find Servers That Handled Most Number of RequestsC++PythonO(nlogk)O(k)HardSortedList
1642Furthest Building You Can ReachC++PythonO(nlogk)O(k)Medium
1675Minimize Deviation in ArrayC++PythonO((n * log(max_num)) * logn)O(n)Hard


Tree

#TitleSolutionTimeSpaceDifficultyTagNote
0094Binary Tree Inorder TraversalC++PythonO(n)O(1)MediumMorris Traversal
0099Recover Binary Search TreeC++PythonO(n)O(1)HardMorris Traversal
0144Binary Tree Preorder TraversalC++PythonO(n)O(1)MediumMorris Traversal
0145Binary Tree Postorder TraversalC++PythonO(n)O(1)HardMorris Traversal
0208Implement Trie (Prefix Tree)C++PythonO(n)O(1)MediumTrie
0211Add and Search Word - Data structure designC++PythonO(min(n, h))O(min(n, h))MediumTrie, DFS
0226Invert Binary TreeC++PythonO(n)O(h),O(w)Easy
0297Serialize and Deserialize Binary TreeC++PythonO(n)O(h)HardLintCodeDFS
0307Range Sum Query - MutableC++Pythonctor:O(n), update:O(logn), query:O(logn)O(n)MediumLintCodeDFS, Segment Tree, BIT, Fenwick Tree
0308Range Sum Query 2D - MutableC++Pythonctor:O(m * n), update:O(logm * logn), query:O(logm * logn)O(m * n)Hard🔒DFS, Quad Tree, 2D BIT, 2D Fenwick Tree
0315Count of Smaller Numbers After SelfC++PythonO(nlogn)O(n)HardLintCodeBST, BIT, Fenwick Tree, Divide and Conquer, Merge Sort
0525Contiguous ArrayC++PythonO(n)O(n)Medium
0529MinesweeperC++PythonO(m * n)O(m + n)Medium
0536Construct Binary Tree from StringC++PythonO(n)O(h)Medium🔒
0538Convert BST to Greater TreeC++PythonO(n)O(h)Easy
0543Diameter of Binary TreeC++PythonO(n)O(h)Easy
0545Boundary of Binary TreeC++PythonO(n)O(h)Medium🔒
0548Split Array with Equal SumC++PythonO(n^2)O(n)Medium🔒
0563Binary Tree TiltC++PythonO(n)O(n)Easy
0572Subtree of Another TreeC++PythonO(m * n)O(h)Easy
0606Construct String from Binary TreeC++PythonO(n)O(h)Easy
0617Merge Two Binary TreesC++PythonO(n)O(h)Easy
0623Add One Row to TreeC++PythonO(n)O(h)Medium
0637Average of Levels in Binary TreeC++PythonO(n)O(h)Easy
0652Find Duplicate SubtreesC++PythonO(n)O(n)MediumDFS, Hash
0653Two Sum IV - Input is a BSTC++PythonO(n)O(h)EasyTwo Pointers
0654Maximum Binary TreeC++PythonO(n)O(n)MediumLintCodeMono Stack, Cartesian Tree
0655Print Binary TreeC++PythonO(n)O(h)Medium
0662Maximum Width of Binary TreeC++PythonO(n)O(h)MediumDFS
0663Equal Tree PartitionC++PythonO(n)O(n)Medium🔒Hash
0677Map Sum PairsC++PythonO(n)O(t)MediumTrie
0684Redundant ConnectionC++PythonO(n)O(n)MediumUnion Find
0685Redundant Connection IIC++PythonO(n)O(n)HardUnion Find
0687Longest Univalue PathC++PythonO(n)O(h)Easy
0699Falling SquaresC++PythonO(nlogn)O(n)HardSegment Tree
0814Binary Tree PruningC++PythonO(n)O(h)MediumDFS
0850Rectangle Area IIC++PythonO(nlogn)O(n)HardSegment Tree
0863All Nodes Distance K in Binary TreeC++PythonO(n)O(n)MediumDFS + BFS
0866Smallest Subtree with all the Deepest NodesC++PythonO(n)O(h)MediumDFS
0889Construct Binary Tree from Preorder and Postorder TraversalC++PythonO(n)O(h)MediumDFS, stack
0897Increasing Order Search TreeC++PythonO(n)O(h)EasyDFS
0919Complete Binary Tree InserterC++Pythonctor:O(n)
insert:O(1)
get_root:O(1)
O(n)Medium
0938Range Sum of BSTC++PythonO(n)O(h)MediumDFS
0951Flip Equivalent Binary TreesC++PythonO(n)O(h)MediumDFS
0958Check Completeness of a Binary TreeC++PythonO(n)O(w)MediumBFS
0965Univalued Binary TreeC++PythonO(n)O(h)EasyDFS
0971Flip Binary Tree To Match Preorder TraversalC++PythonO(n)O(h)MediumDFS
0979Distribute Coins in Binary TreeC++PythonO(n)O(h)MediumDFS
0987Vertical Order Traversal of a Binary TreeC++PythonO(nlogn)O(n)MediumDFS
0988Smallest String Starting From LeafC++PythonO(n + l * h)O(h)MediumDFS
0993Cousins in Binary TreeC++PythonO(n)O(h)EasyDFS
0998Maximum Binary Tree IIC++PythonO(h)O(1)MediumCartesian Tree
1008Construct Binary Search Tree from Preorder TraversalC++PythonO(n)O(h)Medium
1022Sum of Root To Leaf Binary NumbersC++PythonO(n)O(h)Easy
1026Maximum Difference Between Node and AncestorC++PythonO(n)O(h)MediumDFS
1028Recover a Tree From Preorder TraversalC++PythonO(n)O(h)HardDFS
1032Stream of CharactersC++C++PythonPythonctor:O(n)
query:O(m)
O(t)HardAho-Corasick Automata, Trie
1038Binary Search Tree to Greater Sum TreeC++PythonO(n)O(h)MediumDFS
1065Index Pairs of a StringC++PythonO(n + m + z)O(t)Easy🔒Aho-Corasick Automata, Trie
1080Insufficient Nodes in Root to Leaf PathsC++PythonO(n)O(h)MediumDFS
1104Path In Zigzag Labelled Binary TreeC++PythonO(logn)O(logn)EasyMath
1120Maximum Average SubtreeC++PythonO(n)O(h)Easy🔒DFS
1123Lowest Common Ancestor of Deepest LeavesC++PythonO(n)O(h)MediumDFS
1145Binary Tree Coloring GameC++PythonO(n)O(h)MediumDFS
1257Smallest Common RegionC++PythonO(m * n)O(n)Medium
1261Find Elements in a Contaminated Binary TreeC++PythonO(n)O(h)MediumDFS
1325Delete Leaves With a Given ValueC++PythonO(n)O(h)MediumDFS
1339Maximum Product of Splitted Binary TreeC++PythonO(n)O(h)MediumDFS
1409Queries on a Permutation With KeyC++PythonO(nlogn)O(n)MediumBIT, Fenwick Tree
1430Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary TreeC++PythonO(n)O(h)Medium🔒BFS, DFS, Stack
1443Minimum Time to Collect All Apples in a TreeC++PythonO(n)O(n)MediumDFS, Stack
1448Count Good Nodes in Binary TreeC++PythonO(n)O(h)MediumDFS, Stack
1457Pseudo-Palindromic Paths in a Binary TreeC++PythonO(n)O(h)MediumDFS, Stack
1469Find All The Lonely NodesC++PythonO(n)O(h)Easy🔒DFS, Stack
1490Clone N-ary TreeC++PythonO(n)O(h)Medium🔒DFS, Stack
1505Minimum Possible Integer After at Most K Adjacent Swaps On DigitsC++PythonO(nlogn)O(n)HardBIT, Fenwick Tree
1506Find Root of N-Ary TreeC++PythonO(n)O(1)Medium🔒Bit Manipulation
1516Move Sub-Tree of N-Ary TreeC++PythonO(n)O(h)Hard🔒DFS, Stack
1519Number of Nodes in the Sub-Tree With the Same LabelC++PythonO(n)O(h)MediumDFS, Stack
1522Diameter of N-Ary TreeC++PythonO(n)O(h)Medium🔒DFS, Stack
1530Number of Good Leaf Nodes PairsC++PythonO(n)O(h)MediumDFS, Stack
1612Check If Two Expression Trees are EquivalentC++PythonO(n)O(1)Medium🔒Morris Traversal, Inorder Traversal, Stack, Hash Table
1649Create Sorted Array through InstructionsC++PythonO(nlogn)O(n)Hardvariant ofCount of Smaller Numbers After SelfBIT, Fenwick Tree, Merge Sort
1666Change the Root of a Binary TreeC++PythonO(h)O(1)Medium🔒


Hash Table

#TitleSolutionTimeSpaceDifficultyTagNote
0001Two SumC++PythonO(n)O(n)Easy
0003Longest Substring Without Repeating CharactersC++PythonO(n)O(1)Medium
0030Substring with Concatenation of All WordsC++PythonO((m + n) * k)O(n * k)Hard
0036Valid SudokuC++PythonO(9^2)O(9)Easy
0049Group AnagramsC++PythonO(n * glogg)O(n)Medium
0076Minimum Window SubstringC++PythonO(n)O(k)Hard
0149Max Points on a LineC++PythonO(n^2)O(n)Hard
0159Longest Substring with At Most Two Distinct CharactersC++PythonO(n)O(1)Hard🔒
0170Two Sum III - Data structure designC++PythonO(n)O(n)Easy🔒
0187Repeated DNA SequencesPythonO(n)O(n)Medium
0202Happy NumberC++PythonO(k)O(k)Easy
0204Count PrimesC++PythonO(nlog(logn))O(n)EasySieve of Eratosthenes
0205Isomorphic StringsC++PythonO(n)O(1)Easy
0217Contains DuplicateC++PythonO(n)O(n)Easy
0219Contains Duplicate IIC++PythonO(n)O(n)Easy
0244Shortest Word Distance IIC++Pythonctor:O(n), lookup:O(a + b)O(n)Medium🔒
0246Strobogrammatic NumberC++PythonO(n)O(1)Easy🔒
0249Group Shifted StringsC++PythonO(nlogn)O(n)Easy🔒
0266Palindrome PermutationC++PythonO(n)O(1)Easy🔒
0288Unique Word AbbreviationC++Pythonctor:O(n), lookup:O(1)O(k)Easy🔒
0290Word PatternC++PythonO(n)O(c)Easyvariant ofIsomorphic Strings
0299Bulls and CowsC++PythonO(n)O(1)Easy
0305Number of Islands IIC++PythonO(k)O(k)HardLintCode, 🔒Union Find
0314Binary Tree Vertical Order TraversalC++PythonO(n)O(n)Medium🔒BFS
0323Number of Connected Components in an Undirected GraphC++PythonO(n)O(n)Medium🔒Union Find
0325Maximum Size Subarray Sum Equals kC++PythonO(n)O(n)Medium🔒
0336Palindrome PairsC++PythonO(n * k^2)O(n * k)Hard
0340Longest Substring with At Most K Distinct CharactersC++PythonO(n)O(1)Hard🔒
0356Line ReflectionC++PythonO(n)O(n)Medium🔒Hash, Two Pointers
0387First Unique Character in a StringC++PythonO(n)O(n)Easy
0388Longest Absolute File PathC++PythonO(n)O(d)MediumStack
0409Longest PalindromeC++PythonO(n)O(1)Easy
0438Find All Anagrams in a StringC++PythonO(n)O(1)Easy
0447Number of BoomerangsC++PythonO(n^2)O(n)Easy
04544Sum IIC++PythonO(n^2)O(n^2)Medium
0470Implement Rand10() Using Rand7()C++PythonO(1)O(1)Medium
0473Matchsticks to SquareC++PythonO(n * s * 2^n)O(n * (2^n + s))Medium
0523Continuous Subarray SumC++PythonO(n)O(k)Medium
0532K-diff Pairs in an ArrayC++PythonO(n)O(n)Easy
0554Brick WallC++PythonO(n)O(m)Medium
0560Subarray Sum Equals KC++PythonO(n)O(n)Medium
0561Array Partition IC++PythonO(r)O(r)Easy
0575Distribute CandiesC++PythonO(n)O(n)Easy
0594Longest Harmonious SubsequenceC++PythonO(n)O(n)Easy
0599Minimum Index Sum of Two ListsC++PythonO((m + n) * l)O(m * l)Easy
0609Find Duplicate File in SystemC++PythonO(n * l)O(n * l)Medium
0721Accounts MergeC++PythonO(nlogn)O(n)MediumUnion Find
0734Sentence SimilarityC++PythonO(n + p)O(p)Easy
0737Sentence Similarity IIC++PythonO(n + p)O(p)MediumUnion Find
0748Shortest Completing WordC++PythonO(n)O(1)Easy
0760Find Anagram MappingsC++PythonO(n)O(n)Easy
0771Jewels and StonesC++PythonO(m + n)O(n)Easy
0811Subdomain Visit CountC++PythonO(n)O(n)Easy
0822Card Flipping GameC++PythonO(n)O(n)Medium
0825Friends Of Appropriate AgesC++PythonO(a^2 + n)O(a)Medium
0869Reordered Power of 2C++PythonO(1)O(1)Medium
0873Length of Longest Fibonacci SubsequenceC++PythonO(n^2)O(n)Medium
0957Prison Cells After N DaysC++PythonO(1)O(1)Medium
0966Vowel SpellcheckerC++PythonO(n)O(w)Medium
0974Subarray Sums Divisible by KC++PythonO(n)O(k)Mediumvariant ofSubarray Sum Equals K
0982Triples with Bitwise AND Equal To ZeroC++PythonO(nlogn)O(n)HardMath,Fast Wavelet Transform (FWT)
1001Grid IlluminationC++PythonO(l + q)O(l)Hard
1124Longest Well-Performing IntervalC++PythonO(n)O(n)Medium
1133Largest Unique NumberC++PythonO(n)O(n)Easy🔒Hash
1152Analyze User Website Visit PatternC++PythonO(n^3)O(n^3)Medium🔒Hash
1153String Transforms Into Another StringC++PythonO(n)O(1)Hard🔒Hash
1160Find Words That Can Be Formed by CharactersC++PythonO(m * n)O(1)Easy
1165Single-Row KeyboardC++PythonO(n)O(1)Easy🔒
1198Find Smallest Common Element in All RowsC++PythonO(m * n)O(n)Medium🔒
1207Unique Number of OccurrencesC++PythonO(n)O(n)Easy
1224Maximum Equal FrequencyC++PythonO(n)O(n)Hard
1418Display Table of Food Orders in a RestaurantC++PythonO(n + tlogt + flogf)O(n)Medium
1452People Whose List of Favorite Companies Is Not a Subset of Another ListC++PythonO(n * m * l + n^2 * m)O(n * m * l)Medium
1487Making File Names UniqueC++PythonO(n)O(n)Medium
1577Number of Ways Where Square of Number Is Equal to Product of Two NumbersC++PythonO(m * n)O(m + n)Medium
1590Make Sum Divisible by PC++PythonO(n)O(p)Mediumvariant ofSubarray Sums Divisible by K
1640Check Array Formation Through ConcatenationC++PythonO(n)O(n)Easy
1657Determine if Two Strings Are CloseC++PythonO(n)O(1)Medium
1679Max Number of K-Sum PairsC++PythonO(n)O(n)Medium
1711Count Good MealsC++PythonO(n)O(1)Medium


Math

#TitleSolutionTimeSpaceDifficultyTagNote
0007Reverse IntegerC++PythonO(1)O(1)Easy
0009Palindrome NumberC++PythonO(1)O(1)Easy
0012Integer to RomanC++PythonO(n)O(1)Medium
0013Roman to IntegerC++PythonO(n)O(1)Easy
0029Divide Two IntegersC++PythonO(1)O(1)Medium
0050Pow(x, n)C++PythonO(1)O(1)Medium
0060Permutation SequenceC++PythonO(n^2)O(n)MediumCantor Ordering
0065Valid NumberC++PythonO(n)O(1)HardAutomata
0089Gray CodeC++PythonO(2^n)O(1)Medium
0166Fraction to Recurring DecimalC++PythonO(logn)O(1)Medium
0168Excel Sheet Column TitleC++PythonO(logn)O(1)Easy
0171Excel Sheet Column NumberC++PythonO(n)O(1)Easy
0172Factorial Trailing ZeroesC++PythonO(1)O(1)Easy
0223Rectangle AreaC++PythonO(1)O(1)Easy
0233Number of Digit OneC++PythonO(1)O(1)HardCTCI, LintCode
0248Strobogrammatic Number IIIC++PythonO(5^(n/2))O(n)Hard🔒
0258Add DigitsC++PythonO(1)O(1)Easy
0263Ugly NumberC++PythonO(1)O(1)Easy
0292Nim GameC++PythonO(1)O(1)EasyLintCode
0319Bulb SwitcherC++PythonO(1)O(1)Medium
0326Power of ThreeC++PythonO(1)O(1)Easy
0335Self CrossingC++PythonO(n)O(1)Hard
0338Counting BitsC++PythonO(n)O(n)Medium
0343Integer BreakC++PythonO(logn)O(1)MediumTricky, DP
0365Water and Jug ProblemC++PythonO(logn)O(1)MediumBézout's identity
0372Super PowC++PythonO(n)O(1)Medium
0382Linked List Random NodeC++PythonO(n)O(1)MediumReservoir Sampling
0386Lexicographical NumbersC++PythonO(n)O(1)Medium
0390Elimination GameC++PythonO(logn)O(1)Medium
0391Perfect RectangleC++PythonO(n)O(n)Hard
0398Random Pick IndexC++PythonO(n)O(1)MediumReservoir Sampling
0400Nth DigitC++PythonO(logn)O(1)Easy
0413Arithmetic SlicesC++PythonO(n)O(1)Medium
0423Reconstruct Original Digits from EnglishC++PythonO(n)O(1)MediumGCJ2016 - Round 1B
0441Arranging CoinsC++PythonO(nlogn)O(1)EasyBinary Search
0453Minimum Moves to Equal Array ElementsC++PythonO(n)O(1)Easy
0458Poor PigsC++PythonO(n)O(1)Easy
0469Convex PolygonC++PythonO(n)O(1)Medium🔒
0470Implement Rand10() Using Rand7()C++PythonO(1)O(1)Medium
0478Generate Random Point in a CircleC++PythonO(1)O(1)Medium
0497Random Point in Non-overlapping RectanglesC++Pythonctor:O(n)
pick:O(logn)
O(n)Medium
0517Super Washing MachinesC++PythonO(n)O(1)Hard
0519Random Flip MatrixC++Pythonctor:O(1)
pick:O(1) reset:O(n)
O(n)Medium
0528Random Pick with WeightC++Pythonctor:O(n)
pick:O(logn)
O(n)Medium
0537Complex Number MultiplicationC++PythonO(1)O(1)Medium
0553Optimal DivisionC++PythonO(n)O(1)Medium
0573Squirrel SimulationC++PythonO(n)O(1)Medium🔒
0592Fraction Addition and SubtractionC++PythonO(nlogx)O(n)Medium
0593Valid SquareC++PythonO(1)O(1)Medium
0598Range Addition IIC++PythonO(p)O(1)Easy
0625Minimum FactorizationC++PythonO(loga)O(1)Medium🔒
0628Maximum Product of Three NumbersC++PythonO(n)O(1)Easy
0633Sum of Square NumbersC++PythonO(sqrt(c) * logc)O(1)Easy
0634Find the Derangement of An ArrayC++PythonO(n)O(1)Medium🔒
0640Solve the EquationC++PythonO(n)O(n)Medium
06514 Keys KeyboardC++PythonO(1)O(1)Medium🔒Math, DP
0660Remove 9C++PythonO(logn)O(1)Hard🔒
0672Bulb Switcher IIC++PythonO(1)O(1)Medium
0728Self Dividing NumbersC++PythonO(n)O(1)Medium
0754Reach a NumberC++PythonO(logn)O(1)Medium
0775Global and Local InversionsC++PythonO(n)O(1)Medium
0779K-th Symbol in GrammarC++PythonO(1)O(1)Medium
0780Reaching PointsC++PythonO(log(max(m, n)))O(1)Hard
0781Rabbits in ForestC++PythonO(n)O(n)Medium
0782Transform to ChessboardC++PythonO(n^2)O(n)Hard
0789Escape The GhostsC++PythonO(n)O(1)Medium
0800Similar RGB ColorC++PythonO(1)O(1)Easy🔒
0810Chalkboard XOR GameC++PythonO(1)O(1)Hard
0812Largest Triangle AreaC++PythonO(n^3)O(1)Easy
0829Consecutive Numbers SumC++PythonO(sqrt(n))O(1)Medium
0836Rectangle OverlapC++PythonO(1)O(1)Easy
0858Mirror ReflectionC++PythonO(1)O(1)Medium
0867Prime PalindromeC++PythonO(n^(1/2) * (logn + n^(1/2)))O(logn)Medium
0883Projection Area of 3D ShapesC++PythonO(n^2)O(1)Easy
0887Super Egg DropC++PythonO(klogn)O(1)Hard
0891Sum of Subsequence WidthsC++PythonO(n)O(1)Hard
0899Orderly QueueC++PythonO(n^2)O(n)Hard
0902Numbers At Most N Given Digit SetC++PythonO(logn)O(logn)Hard
0906Super PalindromesC++PythonO(n^0.25 * logn)O(logn)Hard
0907Sum of Subarray MinimumsC++PythonO(n)O(n)MediumMono Stack
0908Smallest Range IC++PythonO(n)O(1)Easy
0910Smallest Range IIC++PythonO(nlogn)O(1)Medium
0914X of a Kind in a Deck of CardsC++PythonO(n * (logn)^2)O(n)Easy
0963Minimum Area Rectangle IIC++PythonO(n^2) ~O(n^3)O(n^2)Medium
0970Powerful IntegersC++PythonO((logn)^2)O(r)Easy
0972Equal Rational NumbersC++PythonO(1)O(1)Hard
1006Clumsy FactorialC++PythonO(1)O(1)Medium
1009Complement of Base 10 IntegerC++PythonO(logn)O(1)Easy
1012Numbers With Repeated DigitsC++PythonO(logn)O(logn)Hard
1015Smallest Integer Divisible by KC++PythonO(k)O(1)Medium
1017Convert to Base -2C++PythonO(logn)O(1)Medium
1025Divisor GameC++PythonO(1)O(1)EasyDP
1037Valid BoomerangC++PythonO(1)O(1)Easy
1041Robot Bounded In CircleC++PythonO(n)O(1)Medium
1067Digit Count in RangeC++PythonO(logn)O(1)Hard🔒, variant ofNumber of Digit One
1073Adding Two Negabinary NumbersC++PythonO(n)O(n)Medium
1079Letter Tile PossibilitiesC++PythonO(n^2)O(n)MediumGenerating Function, Backtracking
1088Confusing Number IIC++PythonO(logn)O(logn)Hard🔒
1103Distribute Candies to PeopleC++PythonO(n + logc)O(1)EasyBinary Search
1118Number of Days in a MonthC++PythonO(1)O(1)Easy🔒
1121Divide Array Into Increasing SequencesC++PythonO(n)O(1)Hard🔒
1128Number of Equivalent Domino PairsC++PythonO(n)O(n)Easy
1131Maximum of Absolute Value ExpressionC++PythonO(n)O(1)Medium
1134Armstrong NumberC++PythonO(klogk)O(k)Easy🔒
1150Check If a Number Is Majority Element in a Sorted ArrayC++PythonO(nlogn)O(1)Easy🔒Binary Search
1157Online Majority Element In SubarrayC++Pythonctor:O(n)
query:O(klogn)
O(n)HardBinary Search, Segment Tree,Boyer–Moore Majority Vote Algorithm
1154Day of the YearC++PythonO(1)O(1)Easy
1175Prime ArrangementsC++PythonO(nlog(logn))O(n)EasySieve of Eratosthenes
1185Day of the WeekC++PythonO(1)O(1)EasyZeller Formula
1197Minimum Knight MovesC++PythonO(1)O(1)Medium🔒DP, Math
1217Play with ChipsC++PythonO(n)O(1)Medium
1227Airplane Seat Assignment ProbabilityC++PythonO(1)O(1)Medium
1232Check If It Is a Straight LineC++PythonO(1)O(1)Easy
1237Find Positive Integer Solution for a Given EquationC++PythonO(n)O(1)Easy
1238Circular Permutation in Binary RepresentationC++PythonO(2^n)O(1)Mediumvariant ofGray Code
1250Check If It Is a Good ArrayC++PythonO(nlogn)O(1)HardBézout's identity
1256Encode NumberC++PythonO(logn)O(1)Medium
1259Handshakes That Don't CrossC++PythonO(n)O(1)HardCatalan Number, DP
1266Minimum Time Visiting All PointsC++PythonO(n)O(1)Easy
1276Number of Burgers with No Waste of IngredientsC++PythonO(1)O(1)Medium
1281Subtract the Product and Sum of Digits of an IntegerC++PythonO(logn)O(1)Easy
1300Sum of Mutated Array Closest to TargetC++PythonO(nlogn)O(1)MediumBinary Search
1317Convert Integer to the Sum of Two No-Zero IntegersC++PythonO(logn)O(1)Easy
1323Maximum 69 NumberC++PythonO(logn)O(1)Easy
1330Reverse Subarray To Maximize Array ValueC++PythonO(n)O(1)Hard
1344Angle Between Hands of a ClockC++PythonO(1)O(1)Medium
1359Count All Valid Pickup and Delivery OptionsC++PythonO(n)O(1)Hard
1360Number of Days Between Two DatesC++PythonO(1)O(1)Easyvariant ofDay of the Year
1362Closest DivisorsC++PythonO(sqrt(n))O(1)Medium
1363Largest Multiple of ThreeC++PythonO(n)O(1)Hard
1390Four DivisorsC++PythonO(n * sqrt(n))O(1)Medium
1401Circle and Rectangle OverlappingC++PythonO(1)O(1)Medium
1415The k-th Lexicographical String of All Happy Strings of Length nC++PythonO(n)O(1)Medium
1442Count Triplets That Can Form Two Arrays of Equal XORC++PythonO(n)O(n)Medium
1447Simplified FractionsC++PythonO(n^2 * logn)O(n^2)Medium
1486XOR Operation in an ArrayC++PythonO(1)O(1)Easy
1492The kth Factor of nC++PythonO(sqrt(n))O(1)Medium
1497Check If Array Pairs Are Divisible by kC++PythonO(n)O(k)Medium
1512Number of Good PairsC++PythonO(n)O(1)Easy
1513Number of Substrings With Only 1sC++PythonO(n)O(1)Medium
1525Number of Good Ways to Split a StringC++PythonO(n)O(1)Medium
1537Get the Maximum ScoreC++PythonO(m + n)O(1)Hard
1551Minimum Operations to Make Array EqualC++PythonO(1)O(1)Medium
1611Minimum One Bit Operations to Make Integers ZeroC++PythonO(logn)O(1)Hardvariant ofGray Code
1641Count Sorted Vowel StringsC++PythonO(1)O(1)MediumBinomial Coefficients
1643Kth Smallest InstructionsC++PythonO((m + n)^2)O(1)HardBinomial Coefficients
1735Count Ways to Make Array With ProductC++PythonO(nlogn)O(logn)HardBinomial Coefficients,Euler's Theorem
1739Building BoxesC++PythonO(1)O(1)Hard
1744Can You Eat Your Favorite Candy on Your Favorite Day?C++PythonO(n)O(n)MediumPrefix Sum


Sort

#TitleSolutionTimeSpaceDifficultyTagNote
0056Merge IntervalsC++PythonO(nlogn)O(1)Hard
0057Insert IntervalC++PythonO(n)O(1)Hard
0075Sort ColorsC++PythonO(n)O(1)MediumTri Partition
0088Merge Sorted ArrayC++PythonO(n)O(1)Easy
0147Insertion Sort ListC++PythonO(n^2)O(1)Medium
0148Sort ListC++PythonO(nlogn)O(logn)Medium
0164Maximum GapC++PythonO(n)O(n)HardTricky
0179Largest NumberC++PythonO(nlogn)O(1)Medium
0218The Skyline ProblemC++PythonO(nlogn)O(n)HardSort, BST
0252Meeting RoomsC++PythonO(nlogn)O(n)Easy🔒
0253Meeting Rooms IIC++PythonO(nlogn)O(n)Medium🔒
0274H-IndexC++PythonO(n)O(n)MediumCounting Sort
0280Wiggle SortC++PythonO(n)O(1)Medium🔒
0324Wiggle Sort IIC++PythonO(n) on averageO(1)Mediumvariant ofSort ColorsTri Partition
0347Top K Frequent ElementsC++PythonO(n)O(n)MediumQuick Select, Heap, Bucket Sort
0406Queue Reconstruction by HeightC++PythonO(n * sqrt(n))O(n)MediumTricky
0451Sort Characters By FrequencyC++PythonO(n)O(n)Medium
0692Top K Frequent WordsC++PythonO(n + klogk) on averageO(n)MediumQuick Select, Heap, Bucket Sort
0912Sort an ArrayC++PythonO(nlogn)O(n)MediumMerge Sort, Quick Sort
0937Reorder Log FilesC++PythonO(nlogn * l)O(l)Easy
0969Pancake SortingC++PythonO(nlogn)O(n)Mediumvariant ofCount of Smaller Numbers After SelfBIT, Fenwick Tree, Merge Sort
0973K Closest Points to OriginC++PythonO(n) on averageO(1)EasyQuick Select, Heap
0976Largest Perimeter TriangleC++PythonO(nlogn)O(1)Easy
1054Distant BarcodesC++PythonO(klogk)O(k)Mediumvariant ofRearrange String k Distance Apart
1086High FiveC++PythonO(nlogn)O(n)Easy🔒
1094Car PoolingC++PythonO(nlogn)O(n)Mediumvariant ofMeeting Rooms II
1122Relative Sort ArrayC++PythonO(nlogn)O(n)Easy
1229Meeting SchedulerC++PythonO(nlogn)O(n)MediumLine Sweep, Heap
1356Sort Integers by The Number of 1 BitsC++PythonO(nlogn)O(1)EasyBit Manipulation
1365How Many Numbers Are Smaller Than the Current NumberC++PythonO(n + m)O(m)EasyCounting Sort
1366Rank Teams by VotesC++PythonO(m * (n + mlogm))O(m^2)Medium
1451Rearrange Words in a SentenceC++PythonO(nlogn)O(n)MediumString
1481Least Number of Unique Integers after K RemovalsC++PythonO(n)O(n)MediumCounting Sort
1509Minimum Difference Between Largest and Smallest Value in Three MovesC++PythonO(n + klogk)O(1)MediumQuick Select
1523Count Odd Numbers in an Interval RangeC++PythonO(1)O(1)Easy
1561Maximum Number of Coins You Can GetC++PythonO(nlogn)O(1)Medium
1588Sum of All Odd Length SubarraysC++PythonO(n)O(1)Easy
1608Special Array With X Elements Greater Than or Equal XC++PythonO(n)O(1)Easyvariant ofH-IndexCounting Sort, Binary Search
1620Coordinate With Maximum Network QualityC++PythonO(n^2)O(1)Medium
1621Number of Sets of K Non-Overlapping Line SegmentsC++PythonO(1)O(n)MediumBinomial Coefficients,Euler's Theorem
1630Arithmetic SubarraysC++PythonO(n * q)O(n)MediumArithmetic Series
1636Sort Array by Increasing FrequencyC++PythonO(nlogn)O(n)Easy
1637Widest Vertical Area Between Two Points Containing No PointsC++PythonO(nlogn)O(n)Medium
1680Concatenation of Consecutive Binary NumbersC++PythonO(n)O(1)Medium
1685Sum of Absolute Differences in a Sorted ArrayC++PythonO(n)O(1)Medium
1688Count of Matches in TournamentC++PythonO(1)O(1)Easy
1703Minimum Adjacent Swaps for K Consecutive OnesC++PythonO(n)O(n)HardPrefix Sum
1716Calculate Money in Leetcode BankC++PythonO(1)O(1)EasyArithmetic Sequence


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
1004Max Consecutive Ones IIIC++PythonO(n)O(1)MediumSliding Window
1033Moving Stones Until ConsecutiveC++PythonO(1)O(1)Easy
1040Moving Stones Until Consecutive IIC++PythonO(nlogn)O(1)Medium
1151Minimum Swaps to Group All 1's TogetherC++PythonO(n)O(1)Medium🔒Sliding Window
1156Swap For Longest Repeated Character SubstringC++PythonO(n)O(1)MediumSliding Window
1176Diet Plan PerformanceC++PythonO(n)O(1)EasySliding Window
1208Get Equal Substrings Within BudgetC++PythonO(n)O(1)MediumSliding Window
1213Intersection of Three Sorted ArraysC++PythonO(n)O(1)Easy🔒
1169Invalid TransactionsC++PythonO(nlogn)O(n)MediumSliding Window, Line Sweep
1214Two Sum BSTsC++PythonO(n)O(n)Medium🔒Stack
1234Replace the Substring for Balanced StringC++PythonO(n)O(t)MediumTwo Pointers, Sliding Window
1248Count Number of Nice SubarraysC++PythonO(n)O(k)Mediumvariant ofSubarrays with K Different IntegersTwo Pointers, Sliding Window
1297Maximum Number of Occurrences of a SubstringC++PythonO(n)O(n)MediumSliding Window,Rabin-Karp Algorithm
1305All Elements in Two Binary Search TreesC++PythonO(n)O(h)MediumStack
1316Distinct Echo SubstringsC++PythonO(n^2 + d)O(r)HardKMP Algorithm, Sliding Window,Rabin-Karp Algorithm
1358Number of Substrings Containing All Three CharactersC++PythonO(n)O(1)MediumSliding Window
1423Maximum Points You Can Obtain from CardsC++PythonO(n)O(1)MediumSliding Window
1425Constrained Subset SumC++PythonO(n)O(k)Hardvariant ofSliding Window MaximumMono Deque, Sliding Window
1456Maximum Number of Vowels in a Substring of Given LengthC++PythonO(n)O(1)MediumSliding Window
1493Longest Subarray of 1's After Deleting One ElementC++PythonO(n)O(1)MediumSliding Window
1498Number of Subsequences That Satisfy the Given Sum ConditionC++PythonO(nlogn)O(n)MediumTwo Pointers
1508Range Sum of Sorted Subarray SumsC++PythonO(nlog(sum(nums)))O(n)MediumBinary Search, Two Pointers, Sliding Window
1521Find a Value of a Mysterious Function Closest to TargetC++PythonO(nlogm)O(logm)HardDP, Two Pointers, Sliding Window
1604Alert Using Same Key-Card Three or More Times in a One Hour PeriodC++PythonO(nlogn)O(n)MediumTwo Pointers, Sliding Window
1658Minimum Operations to Reduce X to ZeroC++PythonO(n)O(1)MediumTwo Pointers
1687Delivering Boxes from Storage to PortsC++PythonO(nlogn)O(n)HardTwo Pointers, Sliding Window
1695Maximum Erasure ValueC++PythonO(n)O(n)MediumTwo Pointers, Sliding Window
1712Ways to Split Array Into Three SubarraysC++PythonO(n)O(n)MediumTwo Pointers, Prefix Sum


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
1106Parsing A Boolean ExpressionC++PythonO(n)O(n)Hard


Binary Search

#TitleSolutionTimeSpaceDifficultyTagNote
0004Median of Two Sorted ArraysC++PythonO(log(min(m, n)))O(1)Hard
0033Search in Rotated Sorted ArrayC++PythonO(logn)O(1)MediumCTCI
0034Search for a RangeC++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, 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
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
0864Random Pick with BlacklistC++Pythonctor:O(b)
pick:O(1)
O(b)Hard
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
1011Capacity To Ship Packages Within D DaysC++PythonO(nlogr)O(1)Medium
1044Longest Duplicate SubstringC++PythonO(nlogn)O(n)HardRabin-Karp Algorithm, Suffix Tree,Ukkonen's Algorithm
1060Missing Element in Sorted ArrayC++PythonO(logn)O(1)Medium🔒
1062Longest Repeating SubstringC++PythonO(nlogn)O(n)Medium🔒Rabin-Karp Algorithm
1064Fixed PointC++PythonO(logn)O(1)Easy🔒
1095Find in Mountain ArrayC++PythonO(logn)O(1)Hard
1110Delete Nodes And Return ForestC++PythonO(n)O(h + d)Medium
1170Compare Strings by Frequency of the Smallest CharacterC++PythonO((m + n)logn)O(n)Easy
1201Ugly Number IIIC++PythonO(logn)O(1)MediumInclusion-Exclusion Principle
1228Missing Number In Arithmetic ProgressionC++PythonO(logn)O(1)Easy
1231Divide ChocolateC++PythonO(nlogn)O(1)Hard
1274Number of Ships in a RectangleC++PythonO(log(m * n))O(log(m * n))HardDivide and Conquer
1283Find the Smallest Divisor Given a ThresholdC++PythonO(logn)O(1)Medium
1287Element Appearing More Than 25% In Sorted ArrayC++PythonO(logn)O(1)Easy
1385Find the Distance Value Between Two ArraysC++PythonO((n + m) * logm)O(1)EasyBinary Search, Two Pointers
1482Minimum Number of Days to Make m BouquetsC++PythonO(nlogd)O(1)Medium
1533Find the Index of the Large IntegerC++PythonO(logn)O(1)Medium🔒
1539Kth Missing Positive NumberC++PythonO(logn)O(1)Easy
1552Magnetic Force Between Two BallsC++PythonO(nlogn + nlogr)O(1)Medium
1618Maximum Font to Fit a Sentence in a ScreenC++PythonO(n + logm)O(1)Medium🔒
1648Sell Diminishing-Valued Colored BallsC++PythonO(nlogm)O(1)Medium
1671Minimum Number of Removals to Make Mountain ArrayC++PythonO(nlogn)O(n)Mediumvariant ofLongest Increasing SubsequenceBinary Search, DP
1713Minimum Operations to Make a SubsequenceC++PythonO(nlogn)O(n)Hardvariant ofLongest Increasing SubsequenceBinary Search, Segment Tree


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🔒
1373Maximum Sum BST in Binary TreeC++PythonO(n)O(h)HardDFS, Stack
1382Balance a Binary Search TreeC++PythonO(n)O(h)MediumDFS, Stack


Breadth-First Search

#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++PythonO(|V| + |E|)O(|E|)MediumTopological Sort
0210Course Schedule IIC++PythonO(|V| + |E|)O(|E|)MediumTopological Sort
0261Graph Valid TreeC++PythonO(|V| + |E|)O(|V| + |E|)Medium🔒
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++PythonO(|E| * log|V|)O(|E|)MediumDijkstra's Algorithm
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++PythonO(|E| * log|V|)O(|E|)MediumDijkstra's Algorithm
0815Bus RoutesC++PythonO(|E| + |V|)O(|E| + |V|)Hard
0854K-Similar StringsC++PythonO(n * n!/(c_a!*...*c_z!))O(n * n!/(c_a!*...*c_z!))Hard
0865Shortest 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++PythonO(|E| * log|V|)O(|E|)HardDijkstra's Algorithm
0886Possible BipartitionC++PythonO(|V| + |E|)O(|V| + |E|)Medium
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
1034Coloring A BorderC++PythonO(m * n)O(m + n)Medium
1036Escape a Large MazeC++PythonO(n^2)O(n)Hard
1091Shortest Path in Binary MatrixC++PythonO(n^2)O(n)Medium
1102Path With Maximum Minimum ValueC++PythonO((m * n) * log(m * n))O(m * n)Medium🔒Binary Search, DFS,Dijkstra's Algorithm
1129Shortest Path with Alternating ColorsC++PythonO(n + e)O(n + e)Medium
1136Parallel CoursesC++PythonO(|V| + |E|)O(|E|)Hard🔒Topological Sort
1161Maximum Level Sum of a Binary TreeC++PythonO(n)O(w)MediumDFS
1162As Far from Land as PossibleC++PythonO(m * n)O(m * n)Medium
1203Sort Items by Groups Respecting DependenciesC++PythonO(n + e)O(n + e)HardTopological Sort
1210Minimum Moves to Reach Target with RotationsC++PythonO(n)O(n)Hard
1215Stepping NumbersC++PythonO(logk + r)O(k)Medium🔒Precompute, Binary Search
1245Tree DiameterC++PythonO(|V| + |E|)O(|E|)Medium
1263Minimum Moves to Move a Box to Their Target LocationC++PythonO(m^2 * n^2)O(m^2 * n^2)HardA* Search Algorithm
1284Minimum Number of Flips to Convert Binary Matrix to Zero MatrixC++PythonO((m * n) * 2^(m * n))O((m * n) * 2^(m * n))Hard
1291Sequential DigitsC++PythonO(1)O(1)Medium
1293Shortest Path in a Grid with Obstacles EliminationC++PythonO(m * n * k)O(m * n)HardA* Search Algorithm
1298Maximum Candies You Can Get from BoxesC++PythonO(n^2)O(n)Hard
1302Deepest Leaves SumC++PythonO(n)O(w)Medium
1306Jump Game IIIC++PythonO(n)O(n)Medium
1311Get Watched Videos by Your FriendsC++PythonO(n + vlogv)O(w)Medium
1345Jump Game IVC++PythonO(n)O(n)Hard
1368Minimum Cost to Make at Least One Valid Path in a GridC++PythonO(m * n)O(m * n)HardA* Search Algorithm, 0-1 BFS, Deque
1514Path with Maximum ProbabilityC++PythonO(|E| * log|V|)O(|E|)MediumDijkstra's Algorithm
1602Find Nearest Right Node in Binary TreeC++PythonO(n)O(w)Medium🔒
1609Even Odd TreeC++PythonO(n)O(w)Medium
1625Lexicographically Smallest String After Applying OperationsC++PythonO(n^2)O(1)MediumBFS, String
1654Minimum Jumps to Reach HomeC++PythonO(max(x, max(forbidden)) + a + b)O(max(x, max(forbidden)) + a + b)MediumBFS
1660Correct a Binary TreeC++PythonO(n)O(w)Medium🔒BFS
1728Cat and Mouse IIC++PythonO((m * n)^2 * (m + n))O((m * n)^2)Hardvariant ofCat and MouseMiniMax, Topological Sort
1730Shortest Path to Get FoodC++PythonO(m * n)O(m + n)Medium🔒BFS


Depth-First Search

#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
0332Reconstruct ItineraryC++PythonO(t! / (n1! * n2! * ... nk!))O(t)Medium
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++PythonO(|V| + |E|)O(|V|)Medium
0797All Paths From Source to TargetC++PythonO(p + r * n)O(n)Medium
0802Find Eventual Safe StatesC++PythonO(|V| + |E|)O(|V|)Medium
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
1020Number of EnclavesC++PythonO(m * n)O(m * n)Medium
1059All Paths from Source Lead to DestinationC++PythonO(n + e)O(n + e)Medium🔒
1192Critical Connections in a NetworkC++PythonO(|V| + |E|)O(|V| + |E|)HardTarjan's Algorithm,Bridge Finding Algorithm
1202Smallest String With SwapsC++PythonO(nlogn)O(n)MediumUnion Find
1254Number of Closed IslandsC++PythonO(m * n)O(1)Medium
1273Delete Tree NodesC++PythonO(n)O(n)MediumDFS, DP
1315Sum of Nodes with Even-Valued GrandparentC++PythonO(n)O(h)Medium
1319Number of Operations to Make Network ConnectedC++PythonO(|E| + |V|)O(|V|)MediumUnion Find
1367Linked List in Binary TreeC++PythonO(n + l)O(h + l)MediumKMP Algorithm
1372Longest ZigZag Path in a Binary TreeC++PythonO(n)O(h)Medium
1376Time Needed to Inform All EmployeesC++PythonO(n)O(n)Medium
1377Frog Position After T SecondsC++PythonO(n)O(n)HardDFS, Stack, BFS
1391Check if There is a Valid Path in a GridC++PythonO(m * n)O(1)MediumSimulation
1466Reorder Routes to Make All Paths Lead to the City ZeroC++PythonO(n)O(n)MediumDFS, Stack
1485Clone Binary Tree With Random PointerC++PythonO(n)O(h)Medium🔒DFS, Stack
1644Lowest Common Ancestor of a Binary Tree IIC++PythonO(n)O(h)Medium🔒DFS, Stack
1676Lowest Common Ancestor of a Binary Tree IVC++PythonO(n)O(h)Medium🔒DFS, Stack
1722Minimize Hamming Distance After Swap OperationsC++PythonO(n)O(n)MediumFlood Fill, Union Find
1740Find Distance in a Binary TreeC++PythonO(n)O(h)Mediumvariant ofLowest Common Ancestor of a Binary Tree, 🔒


Backtracking

#TitleSolutionTimeSpaceDifficultyTagNote
0017Letter Combinations of a Phone NumberC++PythonO(n * 4^n)O(1)Medium
0022Generate ParenthesesC++PythonO(4^n / n^(3/2))O(n)Medium
0037Sudoku SolverPythonO((9!)^9)O(1)Hard
0039Combination SumPythonO(k * n^k)O(k)Medium
0040Combination Sum IIPythonO(k * C(n, k))O(k)Medium
0046PermutationsPythonO(n * n!)O(n)Medium
0047Permutations IIPythonO(n * n!)O(n)Medium
0051N-QueensPythonO(n!)O(n)Hard
0052N-Queens-IIPythonO(n!)O(n)Hard
0077CombinationsC++PythonO(O(k * C(n, k)))O(k)Medium
0079Word SearchC++PythonO(m * n * 3^l)O(l)Medium
0093Restore IP AddressesPythonO(1)O(1)Medium
0078SubsetsC++PythonO(n * 2^n)O(1)Medium
0090Subsets IIC++PythonO(n * 2^n)O(1)Medium
0126Word Ladder IIC++PythonO(b^(d/2))O(w * l)HardCTCIBi-BFS
0131Palindrome PartitioningPythonO(n^2) ~O(2^n)O(n^2)Medium
0140Word Break IIC++PythonO(n * l^2 + n * r)O(n^2)Hard
0212Word Search IIC++PythonO(m * n * 3^h)O(t)HardLintCodeTrie, DFS
0216Combination Sum IIIC++PythonO(k * C(n, k))O(k)Medium
0254Factor CombinationsC++PythonO(nlogn)O(logn)Medium🔒
0267Palindrome Permutation IIC++PythonO(n * n!)O(n)Medium🔒
0291Word Pattern IIC++PythonO(n * C(n - 1, c - 1))O(n + c)Hard🔒
0294Flip Game IIC++PythonO(n + c^2)O(c)Medium🔒DP, Hash
0320Generalized AbbreviationC++PythonO(n * 2^n)O(n)Medium🔒
0425Word SquaresC++PythonO(n^2 * n!)O(n^2)Hard🔒
0526Beautiful ArrangementC++PythonO(n!)O(n)Medium
0676Implement Magic DictionaryC++PythonO(n)O(d)MediumTrie, DFS
067924 GameC++PythonO(1)O(1)HardDFS
0698Partition to K Equal Sum SubsetsC++PythonO(n * 2^n)O(2^n)MediumDFS, DP, Memoization
0718Maximum Length of Repeated SubarrayC++PythonO(m * n)O(min(m, n))MediumDP, Hash, Binary Search
0784Letter Case PermutationC++PythonO(n * 2^n)O(1)Easy
0996Number of Squareful ArraysC++PythonO(n!)O(n^2)Hard
1087Brace ExpansionC++PythonO(p * l * log(p * l))O(p * l)Medium🔒
1096Brace Expansion IIC++PythonO(p * l * log(p * l))O(p * l)Hard
1219Path with Maximum GoldC++PythonO(m^2 * n^2)O(m * n)Medium
1240Tiling a Rectangle with the Fewest SquaresC++PythonO(n^2 * m^2 * m^(n * m))O(n * m)Hard
1255Maximum Score Words Formed by LettersC++PythonO(n * 2^n)O(n)Hard
1258Synonymous SentencesC++PythonO(p * l * log(p * l))O(p * l)MediumUnion Find
1307Verbal Arithmetic PuzzleC++PythonO(10! * n * l)O(n * l)Hard
1379Find a Corresponding Node of a Binary Tree in a Clone of That TreeC++PythonO(n)O(h)MediumStack
1593Split a String Into the Max Number of Unique SubstringsC++PythonO(n * 2^(n - 1))O(n)Medium
1659Maximize Grid HappinessC++PythonO(C(m * n, i) * C(m * n - i, e))O(min(m * n, i + e))HardPruning
1718Construct the Lexicographically Largest Valid SequenceC++PythonO(n!)O(b)MediumBacktracking
1723Find Minimum Time to Finish All JobsC++PythonO(k^n * logr)O(n + k)HardBacktracking, Pruning, Binary Search


Dynamic Programming

#TitleSolutionTimeSpaceDifficultyTagNote
0010Regular Expression MatchingPythonO(m * n)O(n)Hard
0044Wildcard MatchingPythonO(m * n)O(1)HardGreedy
0053Maximum SubarrayC++PythonO(n)O(1)Medium
0062Unique PathsPythonO(m * n)O(m + n)Medium
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^2)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
0509Fibonacci NumberC++PythonO(logn)O(1)Easyvariant ofClimbing StairsMatrix Exponentiation
0514Freedom TrailC++PythonO(k) ~O(k * r^2)O(r)Hard
0516Longest Palindromic SubsequenceC++PythonO(n^2)O(n)Medium
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 ofPredict 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
1027Longest Arithmetic SequenceC++PythonO(n^2)O(n^2)Medium
1035Uncrossed LinesC++PythonO(m * n)O(min(m, n))Medium
1039Minimum Score Triangulation of PolygonC++PythonO(n^3)O(n^2)Medium
1043Partition Array for Maximum SumC++PythonO(n * k)O(k)Medium
1048Longest String ChainC++PythonO(n * l^2)O(n * l)Medium
1049Last Stone Weight IIC++PythonO(2^n)O(2^n)Medium
1066Campus Bikes IIC++PythonO(w * b * 2^b)O(w * b * 2^b)Medium🔒
1092Shortest Common SupersequenceC++PythonO(m * n)O(m * n)Hard
1105Filling Bookcase ShelvesC++PythonO(n^2)O(n)Medium
1125Smallest Sufficient TeamC++PythonO(m * 2^n)O(2^n)Hard
1137N-th Tribonacci NumberC++PythonO(logn)O(1)Easyvariant ofFibonacci NumberMatrix Exponentiation
1139Largest 1-Bordered SquareC++PythonO(n^3)O(n^2)Medium
1140Stone Game IIC++PythonO(n*(logn)^2)O(nlogn)Medium
1143Longest Common SubsequenceC++PythonO(m * n)O(min(m, n))Medium
1155Number of Dice Rolls With Target SumC++PythonO(d * f * t)O(t)Medium
1182Shortest Distance to Target ColorC++PythonO(n)O(n)Medium🔒
1186Maximum Subarray Sum with One DeletionC++PythonO(n)O(1)Medium
1187Make Array Strictly IncreasingC++PythonO(n^2 * logn)O(n)Hard
1191K-Concatenation Maximum SumC++PythonO(n)O(1)Medium
1216Valid Palindrome IIIC++PythonO(n^2)O(n)Hard🔒, variant ofLongest Palindromic Subsequence
1218Longest Arithmetic Subsequence of Given DifferenceC++PythonO(n)O(n)Medium
1220Count Vowels PermutationC++PythonO(logn)O(1)HardMatrix Exponentiation
1223Dice Roll SimulationC++PythonO(m * n)O(m)Medium
1230Toss Strange CoinsC++PythonO(n^2)O(n)Medium
1235Maximum Profit in Job SchedulingC++PythonO(nlogn)O(n)HardDP, Heap
1239Maximum Length of a Concatenated String with Unique CharactersC++PythonO(n) ~O(2^n)O(1) ~O(2^n)MediumDP, Bit Manipulation
1246Palindrome RemovalC++PythonO(n^3)O(n^2)Hard
1262Greatest Sum Divisible by ThreeC++PythonO(n)O(1)Medium
1269Number of Ways to Stay in the Same Place After Some StepsC++PythonO(n^2)O(n)Hard
1277Count Square Submatrices with All OnesC++PythonO(m * n)O(1)Medium
1278Palindrome Partitioning IIIC++PythonO(k * n^2)O(n^2)Hard
1289Minimum Falling Path Sum IIC++PythonO(m * n)O(1)Hard
1292Maximum Side Length of a Square with Sum Less than or Equal to ThresholdC++PythonO(m * n * log(min(m, n)))O(m * n)MediumBinary Search
1301Number of Paths with Max ScoreC++PythonO(n^2)O(n)Hard
1312Minimum Insertion Steps to Make a String PalindromeC++PythonO(n^2)O(n)Hardvariant ofLongest Common Subsequence
1314Matrix Block SumC++PythonO(m * n)O(m * n)Mediumvariant ofRange Sum Query 2D - Immutable
1320Minimum Distance to Type a Word Using Two FingersC++PythonO(n)O(1)Hard
1335Minimum Difficulty of a Job ScheduleC++PythonO(d * n^2)O(d * n)Hard
1340Jump Game VC++PythonO(n)O(n)HardSliding Window, Mono Stack, Segment Tree
1349Maximum Students Taking ExamC++PythonO(m * n * sqrt(m * n))O(m + n)HardGCJ2008 - Round 3Hopcroft-Karp Bipartite Matching,Hungarian Bipartite Matching
1387Sort Integers by The Power ValueC++PythonO(n) on averageO(n)MediumQuick Select
1388Pizza With 3n SlicesC++PythonO(n^2)O(n)Hardvariant ofHouse Robber II
1395Count Number of TeamsC++PythonO(n^2)O(1)Medium
1397Find All Good StringsC++PythonO(m * n)O(m)HardKMP Algorithm
1406Stone Game IIIC++PythonO(n)O(1)Hard
1411Number of Ways to Paint N × 3 GridC++PythonO(logn)O(1)HardMatrix Exponentiation
1416Restore The ArrayC++PythonO(nlogk)O(logk)Hard
1420Build Array Where You Can Find The Maximum Exactly K ComparisonsC++PythonO(n * m * k)O(m * k)Hard
1434Number of Ways to Wear Different Hats to Each OtherC++PythonO(h * 2^n)O(2^n)Hard
1444Number of Ways of Cutting a PizzaC++PythonO(m * n * k * (m + n))O(m * n * k)Hard
1449Form Largest Integer With Digits That Add up to TargetC++PythonO(t)O(t)Hard
1458Max Dot Product of Two SubsequencesC++PythonO(m * n)O(min(m, n))Hard
1463Cherry Pickup IIC++PythonO(m * n^2)O(n^2)Hard
1467Probability of a Two Boxes Having The Same Number of Distinct BallsC++PythonO(k^3 * n^2)O(k^2 * n)HardBinomial Coefficients
1473Paint House IIIC++PythonO(m * t * n^2)O(t * n)Hard
1477Find Two Non-overlapping Sub-arrays Each With Target SumC++PythonO(n)O(n)Medium
1478Allocate MailboxesC++PythonO(m * n^2)O(n)HardDP, Math
1494Parallel Courses IIC++PythonO((n * C(c, min(c, k))) * 2^n)O(2^n)HardCombinations
1504Count Submatrices With All OnesC++PythonO(m * n)O(n)MediumMono Stack
1510Stone Game IVC++PythonO(n * sqrt(n))O(n)Hard
1524Number of Sub-arrays With Odd SumC++PythonO(n)O(1)Medium
1531String Compression IIC++PythonO(n^2 * k)O(n * k)Hard
1547Minimum Cost to Cut a StickC++PythonO(n^3)O(n^2)Hard
1548The Most Similar Path in a GraphC++PythonO(n^ * m)O(n * m)Hard🔒
1553Minimum Number of Days to Eat N OrangesC++PythonO((logn)^2)O((logn)^2)Hard
1563Stone Game VC++PythonO(n^2)O(n^2)Hard
1569Number of Ways to Reorder Array to Get Same BSTC++PythonO(n^2)O(n^2)HardDFS
1575Count All Possible RoutesC++PythonO(nlogn + n * f)O(n * f)HardMath
1594Maximum Non Negative Product in a MatrixC++PythonO(m * n)O(n)Medium
1595Minimum Cost to Connect Two Groups of PointsC++PythonO(m * n * 2^n)O(2^n)Hard
1617Count Subtrees With Max Distance Between CitiesC++PythonO(n^6)O(n^3)HardBacktracking, Graph
1626Best Team With No ConflictsC++PythonO(nloga)O(n)Mediumvariant ofLongest Increasing SubsequenceSort, DP, Segment Tree
1639Number of Ways to Form a Target String Given a DictionaryC++PythonO(l * (w + n))O(n)Hard
1655Distribute Repeating IntegersC++PythonO(n + m * 3^m)O(n + 2^m)HardSubmask Enumeration
1664Ways to Make a Fair ArrayC++PythonO(n)O(1)MediumPrefix Sum
1681Minimum IncompatibilityC++PythonO(max(n * 2^n, 3^n))O(2^n)HardCombinations, Backtracking, Submask Enumeration
1682Longest Palindromic Subsequence IIC++PythonO(n^2)O(n)Medium🔒
1690Stone Game VIIC++PythonO(n^2)O(n)Medium
1691Maximum Height by Stacking CuboidsC++PythonO(n^2)O(n)Hard
1692Count Ways to Distribute CandiesC++PythonO(n * k)O(k)Hard🔒
1745Palindrome Partitioning IVC++PythonO(n^2)O(n)HardDP,Manacher's Algorithm


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 ofDelete 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
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 ofNon-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
1005Maximize Sum Of Array After K NegationsC++PythonO(n) on averageO(1)EasyQuick Select
1024Video StitchingC++PythonO(nlogn)O(1)Mediumvariant ofJump Game II
1029Two City SchedulingC++PythonO(n) on averageO(1)EasyQuick Select
1053Previous Permutation With One SwapC++PythonO(n)O(1)Medium
1055Shortest Way to Form StringC++PythonO(m + n)O(m)Medium🔒, variant ofMinimum Window Subsequence
1058Minimize Rounding Error to Meet TargetC++PythonO(n) on averageO(n)Medium🔒Quick Select
1081Smallest Subsequence of Distinct CharactersC++PythonO(n)O(1)Mediumsame asRemove Duplicate LettersMono Stack
1090Largest Values From LabelsC++PythonO(nlogn)O(n)Medium
1111Maximum Nesting Depth of Two Valid Parentheses StringsC++PythonO(n)O(1)Medium
1163Last Substring in Lexicographical OrderC++PythonO(n)O(1)Hard
1167Minimum Cost to Connect SticksC++PythonO(nlogn)O(n)Medium🔒
1183Maximum Number of OnesC++PythonO(1)O(1)Hard🔒
1196How Many Apples Can You Put into the BasketC++PythonO(nlogn)O(n)Easy🔒
1199Minimum Time to Build BlocksC++PythonO(nlogn)O(n)Hard🔒
1221Split a String in Balanced StringsC++PythonO(n)O(1)Easy
1247Minimum Swaps to Make Strings EqualC++PythonO(n)O(1)Easy
1249Minimum Remove to Make Valid ParenthesesC++PythonO(n)O(1)MediumStack
1253Reconstruct a 2-Row Binary MatrixC++PythonO(n)O(1)Medium
1272Remove IntervalC++PythonO(n)O(1)MediumLine Sweep
1282Group the People Given the Group Size They Belong ToC++PythonO(n)O(n)Medium
1288Remove Covered IntervalsC++PythonO(nlogn)O(1)MediumLine Sweep
1296Divide Array in Sets of K Consecutive NumbersC++PythonO(nlogn)O(n)Medium
1326Minimum Number of Taps to Open to Water a GardenC++PythonO(n)O(n)Hardvariant ofJump Game II
1338Reduce Array Size to The HalfC++PythonO(n)O(n)MediumCounting Sort
1353Maximum Number of Events That Can Be AttendedC++PythonO(r + nlogn)O(n)MediumHeap, Sort
1354Construct Target Array With Multiple SumsC++PythonO(log(max(t)) * logn)O(n)HardHeap
1386Cinema Seat AllocationC++PythonO(n)O(n)Medium
1400Construct K Palindrome StringsC++PythonO(n)O(1)Medium
1402Reducing DishesC++PythonO(nlogn)O(1)Hard
1403Minimum Subsequence in Non-Increasing OrderC++PythonO(nlogn)O(1)Easy
1405Longest Happy StringC++PythonO(n)O(1)Medium
1414Find the Minimum Number of Fibonacci Numbers Whose Sum Is KC++PythonO(logk)O(1)Medium
1419Minimum Number of Frogs CroakingC++PythonO(n)O(1)Medium
1433Check If a String Can Break Another StringC++PythonO(n)O(1)Medium
1488Avoid Flood in The CityC++PythonO(nlogn)O(n)Medium
1518Water BottlesC++PythonO(logn/logm)O(1)Easy
1520Maximum Number of Non-Overlapping SubstringsC++PythonO(n)O(1)Medium
1526Minimum Number of Increments on Subarrays to Form a Target ArrayC++PythonO(n)O(1)Hard
1536Minimum Swaps to Arrange a Binary GridC++PythonO(n^2)O(1)Medium
1546Maximum Number of Non-Overlapping Subarrays With Sum Equals TargetC++PythonO(n)O(n)Medium
1564Put Boxes Into the Warehouse IC++PythonO(nlogn)O(1)Medium🔒
1567Maximum Length of Subarray With Positive ProductC++PythonO(n)O(1)Medium
1568Minimum Number of Days to Disconnect IslandC++PythonO(m^2 * n^2)O(m * n)MediumDFS
1578Minimum Deletion Cost to Avoid Repeating LettersC++PythonO(n)O(1)Medium
1580Put Boxes Into the Warehouse IIC++PythonO(nlogn)O(1)Medium🔒
1585Check If String Is Transformable With Substring Sort OperationsC++PythonO(n)O(n)Hard
1589Maximum Sum Obtained of Any PermutationC++PythonO(nlogn)O(n)Medium
1591Strange Printer IIC++PythonO(c * m * n + e)O(e)Hard
1599Maximum Profit of Operating a Centennial WheelC++PythonO(n)O(1)Medium
1605Find Valid Matrix Given Row and Column SumsC++PythonO(m + n)O(1)Medium
1616Split Two Strings to Make PalindromeC++PythonO(n)O(1)MediumTwo Pointers
1632Rank Transform of a MatrixC++PythonO(m * n * log(m * n))O(m * n)HardUnion Find
1647Minimum Deletions to Make Character Frequencies UniqueC++PythonO(n)O(1)Medium
1653Minimum Deletions to Make String BalancedC++PythonO(n)O(1)Medium
1663Smallest String With A Given Numeric ValueC++PythonO(n)O(1)Medium
1665Minimum Initial Energy to Finish TasksC++PythonO(nlogn)O(1)Hard
1673Find the Most Competitive SubsequenceC++PythonO(n)O(k)MeidumStack, Greedy
1674Minimum Moves to Make Array ComplementaryC++PythonO(n + k)O(k)Meidum
1686Stone Game VIC++PythonO(nlogn)O(n)Medium
1689Partitioning Into Minimum Number Of Deci-Binary NumbersC++PythonO(n)O(1)Medium
1702Maximum Binary String After ChangeC++PythonO(n)O(1)Medium
1705Maximum Number of Eaten ApplesC++PythonO(nlogn)O(n)MediumHeap
1708Largest Subarray Length KC++PythonO(n)O(1)Easy🔒, variant ofLast Substring in Lexicographical Order
1710Maximum Units on a TruckC++PythonO(nlogn)O(1)Easy
1717Maximum Score From Removing SubstringsC++PythonO(n)O(1)Medium
1725Number Of Rectangles That Can Form The Largest SquareC++PythonO(n)O(1)Easy
1727Largest Submatrix With RearrangementsC++PythonO(m * nlogn)O(1)MediumSort
1733Minimum Number of People to TeachC++PythonO(n * m^2)O(n * m)Medium
1736Latest Time by Replacing Hidden DigitsC++PythonO(1)O(1)Easy
1737Change Minimum Characters to Satisfy One of Three ConditionsC++PythonO(m + n)O(1)MediumPrefix Sum


Graph

#TitleSolutionTimeSpaceDifficultyTagNote
0399Evaluate DivisionC++PythonO(e + q)O(e)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
1042Flower Planting With No AdjacentC++PythonO(n)O(n)Easy
1101The Earliest Moment When Everyone Become FriendsC++PythonO(nlogn)O(n)Medium🔒Union Find
1135Connecting Cities With Minimum CostC++PythonO(nlogn)O(n)Medium🔒Union Find,Kruskal's Algorithm, MST
1168Optimize Water Distribution in a VillageC++PythonO(nlogn)O(n)Hard🔒Union Find
1334Find the City With the Smallest Number of Neighbors at a Threshold DistanceC++PythonO(n^3)O(n^2)MediumFloyd-Warshall Algorithm
1361Validate Binary Tree NodesC++PythonO(n)O(n)MediumDFS, Tree
1462Course Schedule IVC++PythonO(n^3)O(n^2)MediumFloyd-Warshall Algorithm
1489Find Critical and Pseudo-Critical Edges in Minimum Spanning TreeC++PythonO(nlogn)O(n)HardKruskal Algorithm
1557Minimum Number of Vertices to Reach All NodesC++PythonO(e)O(n)Medium
1579Remove Max Number of Edges to Keep Graph Fully TraversableC++PythonO(n + m)O(n)HardUnion Find
1584Min Cost to Connect All PointsC++PythonO(n^2)O(n)MediumUnion Find,Kruskal's Algorithm, MST
1601Maximum Number of Achievable Transfer RequestsC++PythonO((n + r) * 2^r)O(n + r)HardCombinations, Backtracking
1615Maximal Network RankC++PythonO(m + n + k^2)O(m + n)MediumCounting Sort
1627Graph Connectivity With ThresholdC++PythonO(nlogn + q)O(n)HardUnion Find, Math
1631Path With Minimum EffortC++PythonO(m * n * log(m * n))O(m * n)MediumBinary Search, DFS, BFS, Bi-BFS, Union Find,Dijkstra's Algorithm
1697Checking Existence of Edge Length Limited PathsC++PythonO(nlogn + mlogm)O(n)HardUnion Find
1719Number Of Ways To Reconstruct A TreeC++PythonO(nlogn)O(n)Hard
1724Checking Existence of Edge Length Limited Paths IIC++Pythonctor:O(nlogn + mlogm)
query:O(logn)
O(nlogn + m)Hard🔒Versioned Union Find, Binary Lifting
1743Restore the Array From Adjacent PairsC++PythonO(n)O(n)Medium


Geometry

#TitleSolutionTimeSpaceDifficultyTagNote
0587Erect the FenceC++PythonO(nlogn)O(n)HardConvex Hull,Monotone Chain
0892Surface Area of 3D ShapesC++PythonO(n^2)O(1)Easy
1453Maximum Number of Darts Inside of a Circular DartboardC++PythonO(n^2 * logn)O(n)HardLine Sweep
1515Best Position for a Service CentreC++PythonO(n * iter)O(n)HardGeometric Median, Gradient Descent, Weiszfeld's Algorithm
1610Maximum Number of Visible PointsC++PythonO(nlogn)O(n)HardTwo Pointers, Sliding Window


Simulation

#TitleSolutionTimeSpaceDifficultyTagNote
0874Walking Robot SimulationC++PythonO(n + k)O(k)Easy
1138Alphabet Board PathC++PythonO(n)O(1)Medium
1243Array TransformationC++PythonO(n^2)O(n)Easy


Design

#TitleSolutionTimeSpaceDifficultyTagNote
0146LRU CacheC++PythonO(1)O(k)HardOrderedDict
0225Implement Stack using QueuesC++Pythonpush:O(n), pop:O(1), top:O(1)O(n)Easy
0173Binary Search Tree IteratorC++PythonO(1), amortizedO(h)Medium
0284Peeking IteratorC++PythonO(1)O(1)Medium
0348Design Tic-Tac-ToeC++PythonO(1)O(n^2)Medium🔒
0353Design Snake GameC++PythonO(1)O(s)Medium🔒Deque
0355Design TwitterC++PythonO(klogu)O(t + f)MediumLintCodeHeap
0359Logger Rate LimiterC++PythonO(1), amortizedO(k)Easy🔒Deque
0362Design Hit CounterC++PythonO(1), amortizedO(k)Medium🔒Deque
0379Design Phone DirectoryC++PythonO(1)O(n)Medium🔒
0380Insert Delete GetRandom O(1)C++PythonO(1)O(n)Hard
0381Insert Delete GetRandom O(1) - Duplicates allowedC++PythonO(1)O(n)Hard
0432All O`one Data StructureC++PythonO(1)O(n)Hard
0460LFU CacheC++PythonO(1)O(k)Hard
0489Robot Room CleanerC++PythonO(n)O(n)Hard🔒
0535Encode and Decode TinyURLC++PythonO(1)O(n)Medium
0588Design In-Memory File SystemC++Pythonls:O(l + klogk)
mkdir:O(l)
addContentToFile:O(l + c)
readContentFromFile:O(l + c)
O(n + s)Hard🔒
0604Design Compressed String IteratorC++PythonO(1)O(1)Easy🔒
0631Design Excel Sum FormulaC++Pythonset:O((r * c)^2)
get:O(1)
sum:O((r * c)^2)
O(r * c)Hard🔒
0635Design Log Storage SystemC++Pythonput:O(1)
retrieve:O(n + dlogd)
O(n)Medium🔒
0642Design Search Autocomplete SystemC++PythonO(p^2)O(p * t + s)Hard🔒
0715Range ModuleC++Pythonadd:O(n)
remove:O(n)
query:O(logn)
O(n)Hard
0716Max StackC++Pythonpush:O(logn)
pop:O(logn)
popMax:O(logn)
top:O(1)
peekMax:O(1)
O(n)Easy
0745Prefix and Suffix SearchC++Pythonctor:O(w * l^2)
search :O(p + s)
O(t)HardTrie
0900RLE IteratorC++PythonO(n)O(1)Medium
1146Snapshot ArrayC++Pythonset:O(1)
get:O(logn)
O(n)Medium
1166Design File SystemC++Pythoncreate:O(n)
get:O(n)
O(n)Medium🔒
1172Dinner Plate StacksC++Pythonpush:O(logn)
pop:O(1), amortized
popAtStack:(logn)
O(n * c)Hard
1206Design SkiplistC++PythonO(logn), on averageO(n)Hard
1236Web CrawlerC++PythonO(|V| + |E|)O(|V|)Medium🔒BFS, DFS
1244Design A LeaderboardC++Pythonctor:O(1)
add:O(1)
top:O(n)
reset:O(1)
O(n)Medium
1268Search Suggestions SystemC++Pythonctor:O(n * l)
suggest:O(l^2)
O(t)MediumTrie
1286Iterator for CombinationC++PythonO(k)O(k)MediumStack
1348Tweet Counts Per FrequencyC++Pythonadd:O(logn)
query:O(c)
O(n)Medium
1352Product of the Last K NumbersC++Pythonctor:O(1)
add:O(1)
get:O(1)
O(n)Medium
1357Apply Discount Every n OrdersC++Pythonctor:O(m)
getBill:O(p)
O(m)Medium
1381Design a Stack With Increment OperationC++Pythonctor:O(1)
push:O(1)
pop:O(1)
increment:O(1)
O(n)Medium
1396Design Underground SystemC++Pythonctor:O(1)
checkin:O(1)
checkout:O(1)
getaverage:O(1)
O(n)Medium
1429First Unique NumberC++Pythonctor:O(k)
add:O(1)
showFirstUnique:O(1)
O(n)Medium🔒LinkedHashSet
1472Design Browser HistoryC++Pythonctor:O(1)
visit:O(1)
back:O(1)
forward:O(1)
O(n)Medium
1476Subrectangle QueriesC++Pythonctor:O(1)
update:O(1)
get:O(u)
O(u)Medium
1483Kth Ancestor of a Tree NodeC++Pythonctor:O(n * logh)
get:O(logh)
O(n * logh)HardDP, Binary Lifting
1500Design a File Sharing SystemC++Pythonctor:O(1)
join:O(logu + c)
leave:O(logu + c)
request:O(u)
O(u * c)Medium🔒
1570Dot Product of Two Sparse VectorsC++Pythonctor:O(n)
dot_product:O(min(n, m))
O(n)Medium🔒
1586Binary Search Tree Iterator IIC++PythonO(1), amortizedO(h)Medium🔒
1600Throne InheritanceC++Pythonctor:O(1)
birth:O(1)
death:O(1)
inherit:O(n)
O(n)Medium
1603Design Parking SystemC++PythonO(1)O(1)Easy
1622Fancy SequenceC++PythonO(1)O(n)HardEuler's Theorem
1628Design an Expression Tree With Evaluate FunctionC++PythonO(n)O(h)Medium🔒
1656Design an Ordered StreamC++PythonO(1), amortizedO(n)Easy
1670Design Front Middle Back QueueC++PythonO(1)O(n)Medium


Concurrency

#TitleSolutionTimeSpaceDifficultyTagNote
1114Print in OrderC++PythonO(n)O(1)Easy
1115Print FooBar AlternatelyC++PythonO(n)O(1)Medium
1116Print Zero Even OddC++PythonO(n)O(1)Medium
1117Building H2OC++PythonO(n)O(1)Hard
1188Design Bounded Blocking QueueC++PythonO(n)O(1)Medium🔒
1195Fizz Buzz MultithreadedC++PythonO(n)O(1)Medium
1226The Dining PhilosophersC++PythonO(n)O(1)Medium
1242Web Crawler MultithreadedC++PythonO(|V| + |E|)O(|V|)Medium🔒
1279Traffic Light Controlled IntersectionC++PythonO(n)O(1)Easy🔒


SQL

#TitleSolutionTimeSpaceDifficultyTagNote
0175Combine Two TablesMySQLO(m + n)O(m + n)Easy
0176Second Highest SalaryMySQLO(n)O(1)Easy
0177Nth Highest SalaryMySQLO(n^2)O(n)Medium
0178Rank ScoresMySQLO(n^2)O(n)Medium
0180Consecutive NumbersMySQLO(n)O(n)Medium
0181Employees Earning More Than Their ManagersMySQLO(n^2)O(1)Easy
0182Duplicate EmailsMySQLO(n^2)O(n)Easy
0183Customers Who Never OrderMySQLO(n^2)O(1)Easy
0184Department Highest SalaryMySQLO(n^2)O(n)Medium
0185Department Top Three SalariesMySQLO(n^2)O(n)Hard
0196Delete Duplicate EmailsMySQLO(n^2)O(n)Easy
0197Rising TemperatureMySQLO(n^2)O(n)Easy
0262Trips and UsersMySQLO((t * u) + tlogt)O(t)Hard
0511Game Play Analysis IMySQLO(n)O(n)Easy🔒
0512Game Play Analysis IIMySQLO(n)O(n)Easy🔒
0534Game Play Analysis IIIMySQLO(nlogn)O(n)Medium🔒
0550Game Play Analysis IVMySQLO(n)O(n)Medium🔒
1045Customers Who Bought All ProductsMySQLO(n + k)O(n + k)Medium🔒
1050Actors and Directors Who Cooperated At Least Three TimesMySQLO(n)O(n)Easy🔒
1068Product Sales Analysis IMySQLO(m + n)O(m + n)Easy🔒
1069Product Sales Analysis IIMySQLO(n)O(n)Easy🔒
1070Product Sales Analysis IIIMySQLO(n)O(n)Medium🔒
1075Project Employees IMySQLO(m + n)O(m + n)Easy🔒
1076Project Employees IIMySQLO(n)O(n)Easy🔒
1077Project Employees IIIMySQLO((m + n)^2)O(m + n)Medium🔒
1082Sales Analysis IMySQLO(n)O(n)Easy🔒
1083Sales Analysis IIMySQLO(m + n)O(m + n)Easy🔒
1084Sales Analysis IIIMySQLO(m + n)O(m + n)Easy🔒
1097Game Play Analysis VMySQLO(n^2)O(n)Hard🔒
1098Unpopular BooksMySQLO(m + n)O(n)Medium🔒
1107New Users Daily CountMySQLO(n)O(n)Medium🔒
1112Highest Grade For Each StudentMySQLO(nlogn)O(n)Medium🔒
1113Reported PostsMySQLO(n)O(n)Easy🔒
1126Active BusinessesMySQLO(n)O(n)Medium🔒
1127User Purchase PlatformMySQLO(n)O(n)Hard🔒
1132Reported Posts IIMySQLO(m + n)O(n)Medium🔒
1141User Activity for the Past 30 Days IMySQLO(n)O(n)Easy🔒
1142User Activity for the Past 30 Days IIMySQLO(n)O(n)Easy🔒
1148Article Views IMySQLO(nlogn)O(n)Easy🔒
1149Article Views IIMySQLO(nlogn)O(n)Medium🔒
1158Market Analysis IMySQLO(m + n)O(m + n)Medium🔒
1159Market Analysis IIMySQLO(m + n)O(m + n)Hard🔒
1164Product Price at a Given DateMySQLO(mlogn)O(m)Medium🔒
1173Immediate Food Delivery IMySQLO(n)O(1)Easy🔒
1174Immediate Food Delivery IIMySQLO(n)O(m)Medium🔒
1179Reformat Department TableMySQLO(n)O(n)Easy🔒
1193Monthly Transactions IMySQLO(n)O(n)Medium🔒
1194Tournament WinnersMySQLO(m + n + nlogn)O(m + n)Hard🔒
1204Last Person to Fit in the ElevatorMySQLO(nlogn)O(n)Medium🔒
1205Monthly Transactions IIMySQLO(n)O(n)Medium🔒
1211Queries Quality and PercentageMySQLO(n)O(n)Easy
1212Team Scores in Football TournamentMySQLO(nlogn)O(n)Medium
1225Report Contiguous DatesMySQLO(nlogn)O(n)Hard🔒
1241Number of Comments per PostMySQLO(n)O(n)Easy🔒
1251Average Selling PriceMySQLO(n)O(n)Easy🔒
1264Page RecommendationsMySQLO(m + n)O(m)Medium🔒
1270All People Report to the Given ManagerMySQLO(n)O(n)Medium🔒
1280Students and ExaminationsMySQLO((m * n) * log(m * n))O(m * n)Easy🔒
1285Find the Start and End Number of Continuous RangesMySQLO(n)O(n)Medium🔒
1294Weather Type in Each CountryMySQLO(m + n)O(n)Easy🔒
1303Find the Team SizeMySQLO(n)O(n)Easy🔒
1308Running Total for Different GendersMySQLO(nlogn)O(n)Medium🔒
1321Restaurant GrowthMySQLO(n^2)O(n)Medium🔒
1322Ads PerformanceMySQLO(nlogn)O(n)Easy🔒
1327List the Products Ordered in a PeriodMySQLO(n)O(n)Easy🔒
1336Number of Transactions per VisitMySQLO(m + n)O(m + n)Medium🔒
1341Movie RatingMySQLO(nlogn)O(n)Medium🔒
1350Students With Invalid DepartmentsMySQLO(n)O(n)Easy🔒
1355Activity ParticipantsMySQLO(n)O(n)Medium🔒
1364Number of Trusted Contacts of a CustomerMySQLO(n + m + l + nlogn)O(n + m + l)Medium🔒
1369Get the Second Most Recent ActivityMySQLO(nlogn)O(n)Hard🔒
1378Replace Employee ID With The Unique IdentifierMySQLO(n)O(n)Easy🔒
1384Total Sales Amount by YearMySQLO(nlogn)O(n)Hard🔒
1393Capital Gain/LossMySQLO(n)O(n)Medium🔒
1398Customers Who Bought Products A and B but Not CMySQLO(m + n)O(m + n)Medium🔒
1407Top TravellersMySQLO(m + nlogn)O(m + n)Easy🔒
1412Find the Quiet Students in All ExamsMySQLO(m + nlogn)O(m + n)Hard🔒
1421NPV QueriesMySQLO(n)O(n)Medium🔒
1435Create a Session Bar ChartMySQLO(n)O(1)Easy🔒
1440Evaluate Boolean ExpressionMySQLO(n)O(n)Medium🔒
1445Apples & OrangesMySQLO(n)O(n)Medium🔒
1454Active UsersMySQLO(nlogn)O(n)Medium🔒
1459Rectangles AreaMySQLO(n^2)O(n^2)Medium🔒
1468Calculate SalariesMySQLO(m + n)O(m + n)Easy🔒
1479Sales by Day of the WeekMySQLO(m + n)O(n)Hard🔒
1484Group Sold Products By The DateMySQLO(nlogn)O(n)Easy🔒
1495Friendly Movies Streamed Last MonthMySQLO(n)O(n)Easy🔒
1501Countries You Can Safely Invest InMySQLO(n)O(n)Medium🔒
1511Customer Order FrequencyMySQLO(n)O(n)Easy🔒
1517Find Users With Valid E-MailsMySQLO(n)O(n)Easy🔒Regex
1527Patients With a ConditionMySQLO(n)O(n)Easy🔒Regex
1532The Most Recent Three OrdersMySQLO(nlogn)O(n)Medium🔒
1543Fix Product Name FormatMySQLO(nlogn)O(n)Easy🔒
1549The Most Recent Orders for Each ProductMySQLO(nlogn)O(n)Medium🔒
1555Bank Account SummaryMySQLO(m + n)O(m + n)Medium🔒
1565Unique Orders and Customers Per MonthMySQLO(n)O(n)Easy🔒
1571Warehouse ManagerMySQLO(n)O(n)Medium🔒
1581Customer Who Visited but Did Not Make Any TransactionsMySQLO(n)O(n)Easy🔒
1587Bank Account Summary IIMySQLO(m + n)O(m + n)Easy🔒
1596The Most Frequently Ordered Products for Each CustomerMySQLO(n)O(n)Medium🔒
1607Sellers With No SalesMySQLO(nlogm)O(n + m)Medium🔒
1613Find the Missing IDsMySQLO(n^2)O(n)Medium🔒
1623All Valid Triplets That Can Represent a CountryMySQLO(n^3)O(n^3)Easy🔒
1633Percentage of Users Attended a ContestMySQLO(m + nlogn)O(n)Easy🔒
1635Hopper Company Queries IMySQLO(d + r + tlogt)O(d + r + t)Hard🔒
1645Hopper Company Queries IIMySQLO(d + r + tlogt)O(d + r + t)Hard🔒
1651Hopper Company Queries IIIMySQLO(d + r + tlogt)O(d + r + t)Hard🔒
1661Average Time of Process per MachineMySQLO(n)O(n)Easy🔒
1667Fix Names in a TableMySQLO(nlogn)O(n)Easy🔒
1677Product's Worth Over InvoicesMySQLO(nlogn)O(n)Easy🔒
1683Invalid TweetsMySQLO(n)O(n)Easy🔒
1693Daily Leads and PartnersMySQLO(n)O(n)Easy🔒
1699Number of Calls Between Two PersonsMySQLO(n)O(n)Medium🔒
1709Biggest Window Between VisitsMySQLO(nlogn)O(n)Medium🔒
1715Count Apples and OrangesMySQLO(n)O(n)Medium🔒
1729Find Followers CountMySQLO(nlogn)O(n)Easy🔒
1731The Number of Employees Which Report to Each EmployeeMySQLO(nlogn)O(n)Easy🔒
1741Find Total Time Spent by Each EmployeeMySQLO(nlogn)O(n)Easy🔒


Shell Script

#TitleSolutionTimeSpaceDifficultyTagNote
0192Word FrequencyShellO(n)O(k)Medium
0193Valid Phone NumbersShellO(n)O(1)Easy
0194Transpose FileShellO(n^2)O(n^2)Medium
0195Tenth LineShellO(n)O(1)Easy


About

:octocat: (Weekly Update) Python / Modern C++ Solutions of All 1745 LeetCode Problems

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++54.4%
  • Python45.3%
  • Other0.3%

[8]ページ先頭

©2009-2025 Movatter.jp