PhantomCodeAIPhantomCodeAI
FeaturesMock InterviewDashboardJobsPricing
FeaturesMock InterviewDashboardJobsPricing
PhantomCodeAIPhantomCodeAI
FeaturesMock InterviewDashboardJobsPricing
FeaturesMock InterviewDashboardJobsPricing
HomeLeetCode ProblemsSorting

Sorting Problems

400 Sorting LeetCode problems · Solve with AI-powered hints & step-by-step explanations.

153SumMedium163Sum ClosestMedium184SumMedium47Permutations IIMedium49Group AnagramsMedium56Merge IntervalsMedium75Sort ColorsMedium88Merge Sorted ArrayEasy147Insertion Sort ListMedium148Sort ListMedium164Maximum GapMedium169Majority ElementEasy179Largest NumberMedium215Kth Largest Element in an ArrayMedium217Contains DuplicateEasy220Contains Duplicate IIIHard229Majority Element IIMedium242Valid AnagramEasy268Missing NumberEasy274H-IndexMedium295Find Median from Data StreamHard324Wiggle Sort IIMedium347Top K Frequent ElementsMedium349Intersection of Two ArraysEasy350Intersection of Two Arrays IIEasy354Russian Doll EnvelopesHard368Largest Divisible SubsetMedium378Kth Smallest Element in a Sorted MatrixMedium389Find the DifferenceEasy406Queue Reconstruction by HeightMedium414Third Maximum NumberEasy435Non-overlapping IntervalsMedium451Sort Characters By FrequencyMedium452Minimum Number of Arrows to Burst BalloonsMedium455Assign CookiesEasy462Minimum Moves to Equal Array Elements IIMedium472Concatenated WordsHard475HeatersMedium502IPOHard506Relative RanksEasy522Longest Uncommon Subsequence IIMedium524Longest Word in Dictionary through DeletingMedium532K-diff Pairs in an ArrayMedium539Minimum Time DifferenceMedium561Array PartitionEasy581Shortest Unsorted Continuous SubarrayMedium594Longest Harmonious SubsequenceEasy611Valid Triangle NumberMedium621Task SchedulerMedium628Maximum Product of Three NumbersEasy630Course Schedule IIIHard632Smallest Range Covering Elements from K ListsHard645Set MismatchEasy646Maximum Length of Pair ChainMedium658Find K Closest ElementsMedium692Top K Frequent WordsMedium710Random Pick with BlacklistHard719Find K-th Smallest Pair DistanceHard720Longest Word in DictionaryMedium721Accounts MergeMedium726Number of AtomsHard747Largest Number At Least Twice of OthersEasy757Set Intersection Size At Least TwoHard767Reorganize StringMedium768Max Chunks To Make Sorted IIHard769Max Chunks To Make SortedMedium786K-th Smallest Prime FractionMedium791Custom Sort StringMedium792Number of Matching SubsequencesMedium823Binary Trees With FactorsMedium825Friends Of Appropriate AgesMedium826Most Profit Assigning WorkMedium833Find And Replace in StringMedium846Hand of StraightsMedium853Car FleetMedium857Minimum Cost to Hire K WorkersHard869Reordered Power of 2Medium870Advantage ShuffleMedium881Boats to Save PeopleMedium888Fair Candy SwapEasy891Sum of Subsequence WidthsHard893Groups of Special-Equivalent StringsMedium899Orderly QueueHard905Sort Array By ParityEasy910Smallest Range IIMedium912Sort an ArrayMedium922Sort Array By Parity IIEasy9233Sum With MultiplicityMedium937Reorder Data in Log FilesMedium939Minimum Area RectangleMedium945Minimum Increment to Make Array UniqueMedium948Bag of TokensMedium950Reveal Cards In Increasing OrderMedium954Array of Doubled PairsMedium969Pancake SortingMedium973K Closest Points to OriginMedium975Odd Even JumpHard976Largest Perimeter TriangleEasy977Squares of a Sorted ArrayEasy987Vertical Order Traversal of a Binary TreeHard1005Maximize Sum Of Array After K NegationsEasy1029Two City SchedulingMedium1030Matrix Cells in Distance OrderEasy1040Moving Stones Until Consecutive IIMedium1048Longest String ChainMedium1051Height CheckerEasy1054Distant BarcodesMedium1090Largest Values From LabelsMedium1094Car PoolingMedium1122Relative Sort ArrayEasy1169Invalid TransactionsMedium1170Compare Strings by Frequency of the Smallest CharacterMedium1187Make Array Strictly IncreasingHard1200Minimum Absolute DifferenceEasy1202Smallest String With SwapsMedium1235Maximum Profit in Job SchedulingHard1262Greatest Sum Divisible by ThreeMedium1268Search Suggestions SystemMedium1288Remove Covered IntervalsMedium1296Divide Array in Sets of K Consecutive NumbersMedium1300Sum of Mutated Array Closest to TargetMedium1305All Elements in Two Binary Search TreesMedium1311Get Watched Videos by Your FriendsMedium1329Sort the Matrix DiagonallyMedium1331Rank Transform of an ArrayEasy1333Filter Restaurants by Vegan-Friendly, Price and DistanceMedium1337The K Weakest Rows in a MatrixEasy1338Reduce Array Size to The HalfMedium1340Jump Game VHard1346Check If N and Its Double ExistEasy1348Tweet Counts Per FrequencyMedium1353Maximum Number of Events That Can Be AttendedMedium1356Sort Integers by The Number of 1 BitsEasy1363Largest Multiple of ThreeHard1365How Many Numbers Are Smaller Than the Current NumberEasy1366Rank Teams by VotesMedium1383Maximum Performance of a TeamHard1385Find the Distance Value Between Two ArraysEasy1387Sort Integers by The Power ValueMedium1402Reducing DishesHard1403Minimum Subsequence in Non-Increasing OrderEasy1418Display Table of Food Orders in a RestaurantMedium1424Diagonal Traverse IIMedium1433Check If a String Can Break Another StringMedium1451Rearrange Words in a SentenceMedium1460Make Two Arrays Equal by Reversing SubarraysEasy1464Maximum Product of Two Elements in an ArrayEasy1465Maximum Area of a Piece of Cake After Horizontal and Vertical CutsMedium1471The k Strongest Values in an ArrayMedium1478Allocate MailboxesHard1481Least Number of Unique Integers after K RemovalsMedium1489Find Critical and Pseudo-Critical Edges in Minimum Spanning TreeHard1491Average Salary Excluding the Minimum and Maximum SalaryEasy1498Number of Subsequences That Satisfy the Given Sum ConditionMedium1502Can Make Arithmetic Progression From SequenceEasy1508Range Sum of Sorted Subarray SumsMedium1509Minimum Difference Between Largest and Smallest Value in Three MovesMedium1547Minimum Cost to Cut a StickHard1552Magnetic Force Between Two BallsMedium1561Maximum Number of Coins You Can GetMedium1585Check If String Is Transformable With Substring Sort OperationsHard1589Maximum Sum Obtained of Any PermutationMedium1604Alert Using Same Key-Card Three or More Times in a One Hour PeriodMedium1608Special Array With X Elements Greater Than or Equal XEasy1610Maximum Number of Visible PointsHard1619Mean of Array After Removing Some ElementsEasy1626Best Team With No ConflictsMedium1630Arithmetic SubarraysMedium1632Rank Transform of a MatrixHard1636Sort Array by Increasing FrequencyEasy1637Widest Vertical Area Between Two Points Containing No PointsEasy1647Minimum Deletions to Make Character Frequencies UniqueMedium1648Sell Diminishing-Valued Colored BallsMedium1657Determine if Two Strings Are CloseMedium1665Minimum Initial Energy to Finish TasksHard1679Max Number of K-Sum PairsMedium1686Stone Game VIMedium1691Maximum Height by Stacking Cuboids Hard1697Checking Existence of Edge Length Limited PathsHard1710Maximum Units on a TruckEasy1727Largest Submatrix With RearrangementsMedium1738Find Kth Largest XOR Coordinate ValueMedium1751Maximum Number of Events That Can Be Attended IIHard1755Closest Subsequence SumHard1782Count Pairs Of NodesHard1798Maximum Number of Consecutive Values You Can MakeMedium1818Minimum Absolute Sum DifferenceMedium1833Maximum Ice Cream BarsMedium1834Single-Threaded CPUMedium1838Frequency of the Most Frequent ElementMedium1840Maximum Building HeightHard1846Maximum Element After Decreasing and RearrangingMedium1847Closest RoomHard1851Minimum Interval to Include Each QueryHard1859Sorting the SentenceEasy1877Minimize Maximum Pair Sum in ArrayMedium1878Get Biggest Three Rhombus Sums in a GridMedium1887Reduction Operations to Make the Array Elements EqualMedium1889Minimum Space Wasted From PackagingHard1913Maximum Product Difference Between Two PairsEasy1921Eliminate Maximum Number of MonstersMedium1943Describe the PaintingMedium1968Array With Elements Not Equal to Average of NeighborsMedium1984Minimum Difference Between Highest and Lowest of K ScoresEasy1985Find the Kth Largest Integer in the ArrayMedium1996The Number of Weak Characters in the GameMedium1998GCD Sort of an ArrayHard2007Find Original Array From Doubled ArrayMedium2008Maximum Earnings From TaxiMedium2033Minimum Operations to Make a Uni-Value GridMedium2037Minimum Number of Moves to Seat EveryoneEasy2054Two Best Non-Overlapping EventsMedium2070Most Beautiful Item for Each QueryMedium2071Maximum Number of Tasks You Can AssignHard2089Find Target Indices After Sorting ArrayEasy2092Find All People With SecretHard2094Finding 3-Digit Even NumbersEasy2099Find Subsequence of Length K With the Largest SumEasy2122Recover the Original ArrayHard2126Destroying AsteroidsMedium2135Count Words Obtained After Adding a LetterMedium2136Earliest Possible Day of Full BloomHard2141Maximum Running Time of N ComputersHard2144Minimum Cost of Buying Candies With DiscountEasy2146K Highest Ranked Items Within a Price RangeMedium2148Count Elements With Strictly Smaller and Greater Elements Easy2154Keep Multiplying Found Values by TwoEasy2160Minimum Sum of Four Digit Number After Splitting DigitsEasy2164Sort Even and Odd Indices IndependentlyEasy2165Smallest Value of the Rearranged NumberMedium2171Removing Minimum Number of Magic BeansMedium2191Sort the Jumbled NumbersMedium2195Append K Integers With Minimal SumMedium2225Find Players With Zero or One LossesMedium2231Largest Number After Digit Swaps by ParityEasy2234Maximum Total Beauty of the GardensHard2242Maximum Score of a Node SequenceHard2248Intersection of Multiple ArraysEasy2250Count Number of Rectangles Containing Each PointMedium2251Number of Flowers in Full BloomHard2271Maximum White Tiles Covered by a CarpetMedium2273Find Resultant Array After Removing AnagramsEasy2274Maximum Consecutive Floors Without Special FloorsMedium2279Maximum Bags With Full Capacity of RocksMedium2280Minimum Lines to Represent a Line ChartMedium2285Maximum Total Importance of RoadsMedium2294Partition Array Such That Maximum Difference Is KMedium2300Successful Pairs of Spells and PotionsMedium2332The Latest Time to Catch a BusMedium2333Minimum Sum of Squared DifferenceMedium2335Minimum Amount of Time to Fill CupsEasy2342Max Sum of a Pair With Equal Sum of DigitsMedium2343Query Kth Smallest Trimmed NumberMedium2344Minimum Deletions to Make Array DivisibleHard2357Make Array Zero by Subtracting Equal AmountsEasy2363Merge Similar ItemsEasy2386Find the K-Sum of an ArrayHard2389Longest Subsequence With Limited SumEasy2402Meeting Rooms IIIHard2406Divide Intervals Into Minimum Number of GroupsMedium2410Maximum Matching of Players With TrainersMedium2412Minimum Money Required Before TransactionsHard2418Sort the PeopleEasy2421Number of Good PathsHard2441Largest Positive Integer That Exists With Its NegativeEasy2448Minimum Cost to Make Array EqualHard2449Minimum Number of Operations to Make Arrays SimilarHard2454Next Greater Element IVHard2456Most Popular Video CreatorMedium2463Minimum Total Distance TraveledHard2465Number of Distinct AveragesEasy2475Number of Unequal Triplets in ArrayEasy2491Divide Players Into Teams of Equal SkillMedium2497Maximum Star Sum of a GraphMedium2500Delete Greatest Value in Each RowEasy2501Longest Square Streak in an ArrayMedium2503Maximum Number of Points From Grid QueriesHard2512Reward Top K StudentsMedium2517Maximum Tastiness of Candy BasketMedium2542Maximum Subsequence ScoreMedium2545Sort the Students by Their Kth ScoreMedium2551Put Marbles in BagsHard2554Maximum Number of Integers to Choose From a Range IMedium2563Count the Number of Fair PairsMedium2567Minimum Score by Changing Two ElementsMedium2576Find the Maximum Number of Marked IndicesMedium2578Split With Minimum SumEasy2580Count Ways to Group Overlapping RangesMedium2583Kth Largest Sum in a Binary TreeMedium2587Rearrange Array to Maximize Prefix ScoreMedium2589Minimum Time to Complete All TasksHard2592Maximize Greatness of an ArrayMedium2593Find Score of an Array After Marking All ElementsMedium2597The Number of Beautiful SubsetsMedium2602Minimum Operations to Make All Array Elements EqualMedium2607Make K-Subarray Sums EqualMedium2611Mice and CheeseMedium2616Minimize the Maximum Difference of PairsMedium2659Make Array EmptyHard2679Sum in a MatrixMedium2681Power of HeroesHard2706Buy Two ChocolatesEasy2708Maximum Strength of a GroupMedium2713Maximum Strictly Increasing Cells in a MatrixHard2731Movement of RobotsMedium2733Neither Minimum nor MaximumEasy2736Maximum Sum QueriesHard2740Find the Value of the PartitionMedium2747Count Zero Request ServersMedium2751Robot CollisionsHard2766Relocate MarblesMedium2779Maximum Beauty of an Array After Applying OperationMedium2780Minimum Index of a Valid SplitMedium2784Check if Array is GoodEasy2785Sort Vowels in a StringMedium2790Maximum Number of Groups With Increasing LengthHard2809Minimum Time to Make Array Sum At Most xHard2813Maximum Elegance of a K-Length SubsequenceHard2818Apply Operations to Maximize ScoreHard2824Count Pairs Whose Sum is Less than TargetEasy2830Maximize the Profit as the SalesmanMedium2840Check if Strings Can be Made Equal With Operations IIMedium2860Happy StudentsMedium2895Minimum Processing TimeMedium2931Maximum Spending After Buying ItemsHard2933High-Access EmployeesMedium2943Maximize Area of Square Hole in GridMedium2948Make Lexicographically Smallest Array by Swapping ElementsMedium2952Minimum Number of Coins to be AddedMedium2966Divide Array Into Arrays With Max DifferenceMedium2967Minimum Cost to Make Array EqualindromicMedium2968Apply Operations to Maximize Frequency ScoreHard2971Find Polygon With the Largest PerimeterMedium2973Find Number of Coins to Place in Tree NodesHard2974Minimum Number GameEasy2996Smallest Missing Integer Greater Than Sequential Prefix SumEasy3010Divide an Array Into Subarrays With Minimum Cost IEasy3011Find if Array Can Be SortedMedium3016Minimum Number of Pushes to Type Word IIMedium3024Type of TriangleEasy3025Find the Number of Ways to Place People IMedium3027Find the Number of Ways to Place People IIHard3035Maximum Palindromes After OperationsMedium3039Apply Operations to Make String EmptyMedium3041Maximize Consecutive Elements in an Array After ModificationHard3068Find the Maximum Sum of Node ValuesHard3074Apple Redistribution into BoxesEasy3075Maximize Happiness of Selected ChildrenMedium3080Mark Elements on Array by Performing QueriesMedium3081Replace Question Marks in String to Minimize Its ValueMedium3085Minimum Deletions to Make String K-SpecialMedium3098Find the Sum of Subsequence PowersHard3102Minimize Manhattan DistancesHard3107Minimum Operations to Make Median of Array Equal to KMedium3111Minimum Rectangles to Cover PointsMedium3132Find the Integer Added to Array IIMedium3143Maximum Points Inside the SquareMedium3169Count Days Without MeetingsMedium3186Maximum Total Damage With Spell CastingMedium3194Minimum Average of Smallest and Largest ElementsEasy3218Minimum Cost for Cutting Cake IMedium3219Minimum Cost for Cutting Cake IIHard3265Count Almost Equal Pairs IMedium3267Count Almost Equal Pairs IIHard3273Minimum Amount of Damage Dealt to BobHard3281Maximize Score of Numbers in RangesMedium3288Length of the Longest Increasing PathHard3301Maximize the Total Height of Unique TowersMedium3319K-th Largest Perfect Subtree Size in Binary TreeMedium3346Maximum Frequency of an Element After Performing Operations IMedium3347Maximum Frequency of an Element After Performing Operations IIHard3362Zero Array Transformation IIIMedium3365Rearrange K Substrings to Form Target StringMedium3380Maximum Area Rectangle With Point Constraints IMedium3382Maximum Area Rectangle With Point Constraints IIHard3394Check if Grid can be Cut into SectionsMedium3397Maximum Number of Distinct Elements After OperationsMedium3413Maximum Coins From K Consecutive BagsMedium3414Maximum Score of Non-overlapping IntervalsHard3424Minimum Cost to Make Arrays IdenticalMedium3428Maximum and Minimum Sums of at Most Size K SubsequencesMedium3433Count Mentions Per UserMedium3446Sort Matrix by DiagonalsMedium3457Eat Pizzas!Medium3458Select K Disjoint Special SubstringsMedium3462Maximum Sum With at Most K ElementsMedium3467Transform Array by ParityEasy3478Choose K Elements With Maximum SumMedium3517Smallest Palindromic Rearrangement IMedium3531Count Covered BuildingsMedium3534Path Existence Queries in a Graph IIHard3536Maximum Product of Two DigitsEasy3545Minimum Deletions for At Most K Distinct CharactersEasy3547Maximum Sum of Edge Values in a GraphHard3551Minimum Swaps to Sort by Digit SumMedium3556Sum of Largest Prime SubstringsMedium3567Minimum Absolute Difference in Sliding SubmatrixMedium3572Maximize Y‑Sum by Picking a Triplet of Distinct X‑ValuesMedium3606Coupon Code ValidatorEasy3608Minimum Time for K Connected ComponentsMedium
← Browse all LeetCode problems
PhantomCodeAIPhantomCodeAI
PhantomCodeAI is an undetectable desktop application to help you pass your Leetcode interviews.
All systems online
Download

Legal

Refund PolicyTerms of ServiceCancellation PolicyPrivacy Policy

Pages

Contact SupportHelp CenterInstant SupportFAQBlogFeaturesInterview CopilotCoding CopilotInterview QuestionsPricingMock Interview PricingEarn with UsBest AI Interview Assistants 2026FeedbackLeetcode ProblemsLoginCreate Account

Compare

All 29 comparisons →Why switch (29 alternatives) →Interview Coder AlternativeFinal Round AI AlternativeUltraCode AI AlternativeParakeet AI AlternativeAI Apply AlternativeCoderRank AlternativeInterviewing.io AlternativeShadeCoder Alternative

Resources

Salary GuideResume TemplatesWhat Is PhantomCodeAIIs PhantomCodeAI Detectable?Use PhantomCodeAI in HackerRankvs LeetCode PremiumFor European EngineersFor FAANG Interview PrepPost-Layoff ComebackIndia Pricing (INR)

Interview Types

Coding InterviewSystem Design InterviewDSA InterviewLeetCode InterviewAlgorithms InterviewData Structure InterviewSQL InterviewOnline Assessment

Interview Questions

See all →
GoogleAmazonMetaMicrosoftAppleNetflixStripeUberAirbnbBloombergSoftware EngineerFrontend EngineerBackend EngineerData EngineerML EngineerDevOps EngineerData ScientistEngineering ManagerBehavioralSystem Design

Mock Interview by Round Type

All formats →
Mock Interview HubMock Coding InterviewMock Behavioral InterviewMock System Design

AI for Industry Interviews

All industries →
Sales InterviewsPM InterviewsFinance InterviewsConsulting InterviewsDesign Interviews

Coding Interview Patterns

See all patterns →
Coding Interviews HubDynamic ProgrammingTwo Pointers + Sliding WindowGraph AlgorithmsTree AlgorithmsBinary Search

Interview Guides

See all guides →
How to Ace an InterviewHow to Crack InterviewsBest Interview AnswersScreening Interview QuestionsTelephone Interview TipsWorking Interview ExplainedCracking the PM InterviewFAANG 30-Day RoadmapTop 10 LeetCode PatternsSystem Design Prep GuideSTAR Behavioral MethodBehavioral Interview Qs

Alternatives — why engineers switch

See all 29 →
Interview CoderFinal Round AIParakeet AILockedIn AIUltraCode AIShadeCoderSensei AIVerve AICluelyChatGPTBeyz AIInterview SidekickYoodliAlgoMonsterCoderRankExponentFormationInterviewing.ioInterview CakeBig InterviewInterview KickstartPrampScalerAI ApplyCareerflowJobscanKickresumeTeal HQHireVue

AI Interview Tools

AI Interview AssistantAI Interview CoachAI for Job InterviewsAI Interview Preparation ToolReal-Time AI Interview AnswersInterview AI HelperReal-Time AI Interview AssistantAI Interview BotBest AI Interview Tools 2026AI Interview QuestionsPractice Interview QuestionsAI to Answer Interview QuestionsAI Phone Interview HelpAI Interviewing SoftwareAI Interview HubInterview CopilotAI Coding Interview AssistantMock Interview

© 2026 PhantomCodeAI. All rights reserved.