2.14 ✅ Sorting

Sorting #

  • 深刻的理解多路快排。第 75 题。
  • 链表的排序,插入排序(第 147 题)和归并排序(第 148 题)
  • 桶排序和基数排序。第 164 题。
  • “摆动排序”。第 324 题。
  • 两两不相邻的排序。第 767 题,第 1054 题。
  • “饼子排序”。第 969 题。
No.TitleSolutionDifficultyTimeComplexitySpaceComplexityFavoriteAcceptance
00153SumGoMedium32.2%
00163Sum ClosestGoMedium46.2%
00184SumGoMedium36.5%
0049Group AnagramsGoMedium65.9%
0056Merge IntervalsGoMediumO(n log n)O(log n)45.9%
0075Sort ColorsGoMediumO(n)O(1)❤️57.1%
0088Merge Sorted ArrayGoEasy45.7%
0147Insertion Sort ListGoMediumO(n^2)O(1)❤️50.1%
0148Sort ListGoMediumO(n log n)O(log n)❤️54.0%
0164Maximum GapGoHardO(n log n)O(log n)❤️42.6%
0169Majority ElementGoEasy63.8%
0179Largest NumberGoMediumO(n log n)O(log n)❤️34.0%
0215Kth Largest Element in an ArrayGoMedium65.7%
0217Contains DuplicateGoEasy61.3%
0220Contains Duplicate IIIGoHardO(n log n)O(1)❤️21.9%
0229Majority Element IIGoMedium44.0%
0242Valid AnagramGoEasyO(n)O(n)62.7%
0268Missing NumberGoEasy61.5%
0274H-IndexGoMediumO(n)O(n)38.1%
0324Wiggle Sort IIGoMediumO(n)O(n)❤️32.9%
0347Top K Frequent ElementsGoMedium64.8%
0349Intersection of Two ArraysGoEasyO(n)O(n)70.2%
0350Intersection of Two Arrays IIGoEasyO(n)O(n)55.5%
0354Russian Doll EnvelopesGoHard38.3%
0368Largest Divisible SubsetGoMedium41.2%
0378Kth Smallest Element in a Sorted MatrixGoMedium61.6%
0389Find the DifferenceGoEasy60.4%
0414Third Maximum NumberGoEasy32.5%
0435Non-overlapping IntervalsGoMedium49.8%
0436Find Right IntervalGoMedium50.3%
0451Sort Characters By FrequencyGoMedium68.6%
0455Assign CookiesGoEasy50.6%
0462Minimum Moves to Equal Array Elements IIGoMedium60.1%
0475HeatersGoMedium36.1%
0506Relative RanksGoEasy58.9%
0524Longest Word in Dictionary through DeletingGoMediumO(n)O(1)51.2%
0532K-diff Pairs in an ArrayGoMedium40.7%
0561Array PartitionGoEasy76.6%
0581Shortest Unsorted Continuous SubarrayGoMedium36.2%
0594Longest Harmonious SubsequenceGoEasy53.1%
0611Valid Triangle NumberGoMedium50.4%
0628Maximum Product of Three NumbersGoEasy46.4%
0632Smallest Range Covering Elements from K ListsGoHard60.4%
0645Set MismatchGoEasy43.0%
0658Find K Closest ElementsGoMedium46.7%
0692Top K Frequent WordsGoMedium56.8%
0710Random Pick with BlacklistGoHardO(n)O(n)33.6%
0719Find K-th Smallest Pair DistanceGoHard36.3%
0720Longest Word in DictionaryGoMedium51.8%
0726Number of AtomsGoHard52.2%
0747Largest Number At Least Twice of OthersGoEasy46.3%
0767Reorganize StringGoMediumO(n log n)O(log n)❤️52.7%
0786K-th Smallest Prime FractionGoMedium50.7%
0791Custom Sort StringGoMedium69.4%
0792Number of Matching SubsequencesGoMedium51.9%
0825Friends Of Appropriate AgesGoMedium46.4%
0826Most Profit Assigning WorkGoMedium44.4%
0846Hand of StraightsGoMedium56.5%
0853Car FleetGoMediumO(n log n)O(log n)50.0%
0869Reordered Power of 2GoMedium64.0%
0870Advantage ShuffleGoMedium51.7%
0881Boats to Save PeopleGoMedium52.7%
0888Fair Candy SwapGoEasy60.5%
0891Sum of Subsequence WidthsGoHard36.4%
0910Smallest Range IIGoMedium34.5%
0922Sort Array By Parity IIGoEasyO(n)O(1)70.7%
09233Sum With MultiplicityGoMedium45.4%
0969Pancake SortingGoMediumO(n log n)O(log n)❤️70.0%
0973K Closest Points to OriginGoMediumO(n log n)O(log n)65.9%
0976Largest Perimeter TriangleGoEasyO(n log n)O(log n)54.7%
0977Squares of a Sorted ArrayGoEasy71.9%
1005Maximize Sum Of Array After K NegationsGoEasy51.1%
1030Matrix Cells in Distance OrderGoEasyO(n^2)O(1)69.3%
1040Moving Stones Until Consecutive IIGoMedium55.6%
1051Height CheckerGoEasy75.0%
1054Distant BarcodesGoMediumO(n log n)O(log n)❤️45.7%
1122Relative Sort ArrayGoEasy68.4%
1170Compare Strings by Frequency of the Smallest CharacterGoMedium61.3%
1200Minimum Absolute DifferenceGoEasy69.8%
1235Maximum Profit in Job SchedulingGoHard51.1%
1296Divide Array in Sets of K Consecutive NumbersGoMedium56.6%
1300Sum of Mutated Array Closest to TargetGoMedium43.1%
1305All Elements in Two Binary Search TreesGoMedium79.8%
1329Sort the Matrix DiagonallyGoMedium83.6%
1337The K Weakest Rows in a MatrixGoEasy73.0%
1383Maximum Performance of a TeamGoHard48.9%
1385Find the Distance Value Between Two ArraysGoEasy65.4%
1464Maximum Product of Two Elements in an ArrayGoEasy79.3%
1465Maximum Area of a Piece of Cake After Horizontal and Vertical CutsGoMedium40.8%
1608Special Array With X Elements Greater Than or Equal XGoEasy60.0%
1619Mean of Array After Removing Some ElementsGoEasy64.6%
1636Sort Array by Increasing FrequencyGoEasy68.6%
1647Minimum Deletions to Make Character Frequencies UniqueGoMedium59.2%
1648Sell Diminishing-Valued Colored BallsGoMedium30.5%
1657Determine if Two Strings Are CloseGoMedium54.2%
1665Minimum Initial Energy to Finish TasksGoHard56.2%
1679Max Number of K-Sum PairsGoMedium57.4%
1691Maximum Height by Stacking CuboidsGoHard54.2%
1710Maximum Units on a TruckGoEasy74.0%
1818Minimum Absolute Sum DifferenceGoMedium30.1%
1846Maximum Element After Decreasing and RearrangingGoMedium59.0%
1877Minimize Maximum Pair Sum in ArrayGoMedium80.3%
1984Minimum Difference Between Highest and Lowest of K ScoresGoEasy53.5%
2037Minimum Number of Moves to Seat EveryoneGoEasy82.1%
2164Sort Even and Odd Indices IndependentlyGoEasy66.6%
2165Smallest Value of the Rearranged NumberGoMedium51.2%
2171Removing Minimum Number of Magic BeansGoMedium42.0%
——————————————————————-——-—————-—————————-————-————-

⬅️上一页

下一页➡️

Calendar Nov 10, 2022
Edit Edit this page
本站总访问量:  次 您是本站第  位访问者