PhantomCodeAIPhantomCodeAI
FeaturesMock InterviewDashboardJobsPricing
FeaturesMock InterviewDashboardJobsPricing
PhantomCodeAIPhantomCodeAI
FeaturesMock InterviewDashboardJobsPricing
FeaturesMock InterviewDashboardJobsPricing
HomeLeetCode ProblemsGreedy

Greedy Problems

377 Greedy LeetCode problems · Solve with AI-powered hints & step-by-step explanations.

11Container With Most WaterMedium44Wildcard MatchingHard45Jump Game IIMedium55Jump GameMedium122Best Time to Buy and Sell Stock IIMedium134Gas StationMedium135CandyHard179Largest NumberMedium316Remove Duplicate LettersMedium321Create Maximum NumberHard324Wiggle Sort IIMedium330Patching ArrayHard334Increasing Triplet SubsequenceMedium376Wiggle SubsequenceMedium397Integer ReplacementMedium402Remove K DigitsMedium409Longest PalindromeEasy410Split Array Largest SumHard420Strong Password CheckerHard435Non-overlapping IntervalsMedium452Minimum Number of Arrows to Burst BalloonsMedium455Assign CookiesEasy502IPOHard517Super Washing MachinesHard561Array PartitionEasy581Shortest Unsorted Continuous SubarrayMedium605Can Place FlowersEasy611Valid Triangle NumberMedium621Task SchedulerMedium624Maximum Distance in ArraysMedium630Course Schedule IIIHard632Smallest Range Covering Elements from K ListsHard646Maximum Length of Pair ChainMedium649Dota2 SenateMedium659Split Array into Consecutive SubsequencesMedium670Maximum SwapMedium678Valid Parenthesis StringMedium680Valid Palindrome IIEasy714Best Time to Buy and Sell Stock with Transaction FeeMedium738Monotone Increasing DigitsMedium757Set Intersection Size At Least TwoHard763Partition LabelsMedium765Couples Holding HandsHard767Reorganize StringMedium768Max Chunks To Make Sorted IIHard769Max Chunks To Make SortedMedium781Rabbits in ForestMedium807Max Increase to Keep City SkylineMedium826Most Profit Assigning WorkMedium846Hand of StraightsMedium857Minimum Cost to Hire K WorkersHard860Lemonade ChangeEasy861Score After Flipping MatrixMedium870Advantage ShuffleMedium871Minimum Number of Refueling StopsHard881Boats to Save PeopleMedium910Smallest Range IIMedium921Minimum Add to Make Parentheses ValidMedium936Stamping The SequenceHard942DI String MatchEasy945Minimum Increment to Make Array UniqueMedium948Bag of TokensMedium954Array of Doubled PairsMedium955Delete Columns to Make Sorted IIMedium969Pancake SortingMedium976Largest Perimeter TriangleEasy984String Without AAA or BBBMedium991Broken CalculatorMedium1005Maximize Sum Of Array After K NegationsEasy1007Minimum Domino Rotations For Equal RowMedium1013Partition Array Into Three Parts With Equal SumEasy1024Video StitchingMedium1029Two City SchedulingMedium1053Previous Permutation With One SwapMedium1054Distant BarcodesMedium1081Smallest Subsequence of Distinct CharactersMedium1090Largest Values From LabelsMedium1130Minimum Cost Tree From Leaf ValuesMedium1144Decrease Elements To Make Array ZigzagMedium1147Longest Chunked Palindrome DecompositionHard1217Minimum Cost to Move Chips to The Same PositionEasy1221Split a String in Balanced StringsEasy1247Minimum Swaps to Make Strings EqualMedium1253Reconstruct a 2-Row Binary MatrixMedium1262Greatest Sum Divisible by ThreeMedium1282Group the People Given the Group Size They Belong ToMedium1296Divide Array in Sets of K Consecutive NumbersMedium1323Maximum 69 NumberEasy1326Minimum Number of Taps to Open to Water a GardenHard1328Break a PalindromeMedium1330Reverse Subarray To Maximize Array ValueHard1338Reduce Array Size to The HalfMedium1353Maximum Number of Events That Can Be AttendedMedium1363Largest Multiple of ThreeHard1382Balance a Binary Search TreeMedium1383Maximum Performance of a TeamHard1386Cinema Seat AllocationMedium1388Pizza With 3n SlicesHard1400Construct K Palindrome StringsMedium1402Reducing DishesHard1403Minimum Subsequence in Non-Increasing OrderEasy1405Longest Happy StringMedium1414Find the Minimum Number of Fibonacci Numbers Whose Sum Is KMedium1432Max Difference You Can Get From Changing an IntegerMedium1433Check If a String Can Break Another StringMedium1465Maximum Area of a Piece of Cake After Horizontal and Vertical CutsMedium1481Least Number of Unique Integers after K RemovalsMedium1488Avoid Flood in The CityMedium1505Minimum Possible Integer After at Most K Adjacent Swaps On DigitsHard1509Minimum Difference Between Largest and Smallest Value in Three MovesMedium1520Maximum Number of Non-Overlapping SubstringsHard1526Minimum Number of Increments on Subarrays to Form a Target ArrayHard1529Minimum Suffix FlipsMedium1536Minimum Swaps to Arrange a Binary GridMedium1537Get the Maximum ScoreHard1541Minimum Insertions to Balance a Parentheses StringMedium1546Maximum Number of Non-Overlapping Subarrays With Sum Equals TargetMedium1558Minimum Numbers of Function Calls to Make Target ArrayMedium1561Maximum Number of Coins You Can GetMedium1567Maximum Length of Subarray With Positive ProductMedium1578Minimum Time to Make Rope ColorfulMedium1585Check If String Is Transformable With Substring Sort OperationsHard1589Maximum Sum Obtained of Any PermutationMedium1605Find Valid Matrix Given Row and Column SumsMedium1606Find Servers That Handled Most Number of RequestsHard1642Furthest Building You Can ReachMedium1647Minimum Deletions to Make Character Frequencies UniqueMedium1648Sell Diminishing-Valued Colored BallsMedium1663Smallest String With A Given Numeric ValueMedium1665Minimum Initial Energy to Finish TasksHard1671Minimum Number of Removals to Make Mountain ArrayHard1673Find the Most Competitive SubsequenceMedium1675Minimize Deviation in ArrayHard1686Stone Game VIMedium1689Partitioning Into Minimum Number Of Deci-Binary NumbersMedium1702Maximum Binary String After ChangeMedium1703Minimum Adjacent Swaps for K Consecutive OnesHard1705Maximum Number of Eaten ApplesMedium1710Maximum Units on a TruckEasy1713Minimum Operations to Make a SubsequenceHard1717Maximum Score From Removing SubstringsMedium1727Largest Submatrix With RearrangementsMedium1733Minimum Number of People to TeachMedium1736Latest Time by Replacing Hidden DigitsEasy1739Building BoxesHard1753Maximum Score From Removing StonesMedium1754Largest Merge Of Two StringsMedium1764Form Array by Concatenating Subarrays of Another ArrayMedium1775Equal Sum Arrays With Minimum Number of OperationsMedium1785Minimum Elements to Add to Form a Given SumMedium1792Maximum Average Pass RatioMedium1798Maximum Number of Consecutive Values You Can MakeMedium1802Maximum Value at a Given Index in a Bounded ArrayMedium1824Minimum Sideway JumpsMedium1827Minimum Operations to Make the Array IncreasingEasy1833Maximum Ice Cream BarsMedium1838Frequency of the Most Frequent ElementMedium1846Maximum Element After Decreasing and RearrangingMedium1850Minimum Adjacent Swaps to Reach the Kth Smallest NumberMedium1864Minimum Number of Swaps to Make the Binary String AlternatingMedium1877Minimize Maximum Pair Sum in ArrayMedium1881Maximum Value after InsertionMedium1899Merge Triplets to Form Target TripletMedium1903Largest Odd Number in StringEasy1921Eliminate Maximum Number of MonstersMedium1927Sum GameMedium1936Add Minimum Number of RungsMedium1946Largest Number After Mutating SubstringMedium1953Maximum Number of Weeks for Which You Can WorkMedium1962Remove Stones to Minimize the TotalMedium1963Minimum Number of Swaps to Make the String BalancedMedium1968Array With Elements Not Equal to Average of NeighborsMedium1969Minimum Non-Zero Product of the Array ElementsMedium1974Minimum Time to Type Word Using Special TypewriterEasy1975Maximum Matrix SumMedium1996The Number of Weak Characters in the GameMedium2007Find Original Array From Doubled ArrayMedium2014Longest Subsequence Repeated k TimesHard2027Minimum Moves to Convert StringEasy2029Stone Game IXMedium2030Smallest K-Length Subsequence With Occurrences of a LetterHard2037Minimum Number of Moves to Seat EveryoneEasy2038Remove Colored Pieces if Both Neighbors are the Same ColorMedium2064Minimized Maximum of Products Distributed to Any StoreMedium2071Maximum Number of Tasks You Can AssignHard2078Two Furthest Houses With Different ColorsEasy2086Minimum Number of Food Buckets to Feed the HamstersMedium2087Minimum Cost Homecoming of a Robot in a GridMedium2091Removing Minimum and Maximum From ArrayMedium2116Check if a Parentheses String Can Be ValidMedium2126Destroying AsteroidsMedium2131Longest Palindrome by Concatenating Two Letter WordsMedium2132Stamping the GridHard2136Earliest Possible Day of Full BloomHard2139Minimum Moves to Reach Target ScoreMedium2141Maximum Running Time of N ComputersHard2144Minimum Cost of Buying Candies With DiscountEasy2160Minimum Sum of Four Digit Number After Splitting DigitsEasy2170Minimum Operations to Make the Array AlternatingMedium2171Removing Minimum Number of Magic BeansMedium2178Maximum Split of Positive Even IntegersMedium2182Construct String With Repeat LimitMedium2193Minimum Number of Moves to Make PalindromeHard2195Append K Integers With Minimal SumMedium2202Maximize the Topmost Element After K MovesMedium2207Maximize Number of Subsequences in a StringMedium2208Minimum Operations to Halve Array SumMedium2216Minimum Deletions to Make Array BeautifulMedium2224Minimum Number of Operations to Convert TimeEasy2233Maximum Product After K IncrementsMedium2234Maximum Total Beauty of the GardensHard2241Design an ATM MachineMedium2244Minimum Rounds to Complete All TasksMedium2259Remove Digit From Number to Maximize ResultEasy2271Maximum White Tiles Covered by a CarpetMedium2279Maximum Bags With Full Capacity of RocksMedium2285Maximum Total Importance of RoadsMedium2294Partition Array Such That Maximum Difference Is KMedium2310Sum of Numbers With Units Digit KMedium2311Longest Binary Subsequence Less Than or Equal to KMedium2333Minimum Sum of Squared DifferenceMedium2335Minimum Amount of Time to Fill CupsEasy2350Shortest Impossible Sequence of RollsHard2357Make Array Zero by Subtracting Equal AmountsEasy2358Maximum Number of Groups Entering a CompetitionMedium2366Minimum Replacements to Sort the ArrayHard2375Construct Smallest Number From DI StringMedium2383Minimum Hours of Training to Win a CompetitionEasy2384Largest Palindromic NumberMedium2389Longest Subsequence With Limited SumEasy2405Optimal Partition of StringMedium2406Divide Intervals Into Minimum Number of GroupsMedium2410Maximum Matching of Players With TrainersMedium2412Minimum Money Required Before TransactionsHard2429Minimize XORMedium2434Using a Robot to Print the Lexicographically Smallest StringMedium2439Minimize Maximum of ArrayMedium2448Minimum Cost to Make Array EqualHard2449Minimum Number of Operations to Make Arrays SimilarHard2457Minimum Addition to Make Integer BeautifulMedium2472Maximum Number of Non-overlapping Palindrome SubstringsHard2486Append Characters to String to Make SubsequenceMedium2497Maximum Star Sum of a GraphMedium2498Frog Jump IIMedium2499Minimum Total Cost to Make Arrays UnequalHard2517Maximum Tastiness of Candy BasketMedium2522Partition String Into Substrings With Values at Most KMedium2528Maximize the Minimum Powered CityHard2530Maximal Score After Applying K OperationsMedium2541Minimum Operations to Make Array Equal IIMedium2542Maximum Subsequence ScoreMedium2551Put Marbles in BagsHard2554Maximum Number of Integers to Choose From a Range IMedium2560House Robber IVMedium2561Rearranging FruitsHard2566Maximum Difference by Remapping a DigitEasy2567Minimum Score by Changing Two ElementsMedium2571Minimum Operations to Reduce an Integer to 0Medium2573Find the String with LCPHard2576Find the Maximum Number of Marked IndicesMedium2578Split With Minimum SumEasy2587Rearrange Array to Maximize Prefix ScoreMedium2589Minimum Time to Complete All TasksHard2591Distribute Money to Maximum ChildrenEasy2592Maximize Greatness of an ArrayMedium2598Smallest Missing Non-negative Integer After OperationsMedium2600K Items With the Maximum SumEasy2601Prime Subtraction OperationMedium2607Make K-Subarray Sums EqualMedium2611Mice and CheeseMedium2616Minimize the Maximum Difference of PairsMedium2645Minimum Additions to Make Valid StringMedium2656Maximum Sum With Exactly K Elements Easy2659Make Array EmptyHard2663Lexicographically Smallest Beautiful StringHard2673Make Costs of Paths Equal in a Binary TreeMedium2680Maximum ORMedium2697Lexicographically Smallest PalindromeEasy2706Buy Two ChocolatesEasy2708Maximum Strength of a GroupMedium2712Minimum Cost to Make All Characters EqualMedium2734Lexicographically Smallest String After Substring OperationMedium2745Construct the Longest New StringMedium2789Largest Element in an Array after Merge OperationsMedium2790Maximum Number of Groups With Increasing LengthHard2800Shortest String That Contains Three StringsMedium2811Check if it is Possible to Split ArrayMedium2813Maximum Elegance of a K-Length SubsequenceHard2818Apply Operations to Maximize ScoreHard2829Determine the Minimum Sum of a k-avoiding ArrayMedium2834Find the Minimum Possible Sum of a Beautiful ArrayMedium2835Minimum Operations to Form Subsequence With Target SumHard2842Count K-Subsequences of a String With Maximum BeautyHard2844Minimum Operations to Make a Special NumberMedium2856Minimum Array Length After Pair RemovalsMedium2864Maximum Odd Binary NumberEasy2870Minimum Number of Operations to Make Array EmptyMedium2871Split Array Into Maximum Number of SubarraysMedium2895Minimum Processing TimeMedium2897Apply Operations on Array to Maximize Sum of SquaresHard2900Longest Unequal Adjacent Groups Subsequence IEasy2910Minimum Number of Groups to Create a Valid AssignmentMedium2918Minimum Equal Sum of Two Arrays After Replacing ZerosMedium2931Maximum Spending After Buying ItemsHard2938Separate Black and White BallsMedium2939Maximum Xor ProductMedium2952Minimum Number of Coins to be AddedMedium2957Remove Adjacent Almost-Equal CharactersMedium2966Divide Array Into Arrays With Max DifferenceMedium2967Minimum Cost to Make Array EqualindromicMedium2971Find Polygon With the Largest PerimeterMedium3002Maximum Size of a Set After RemovalsMedium3012Minimize Length of Array Using OperationsMedium3014Minimum Number of Pushes to Type Word IEasy3016Minimum Number of Pushes to Type Word IIMedium3022Minimize OR of Remaining Elements Using OperationsHard3035Maximum Palindromes After OperationsMedium3049Earliest Second to Mark Indices IIHard3068Find the Maximum Sum of Node ValuesHard3074Apple Redistribution into BoxesEasy3075Maximize Happiness of Selected ChildrenMedium3081Replace Question Marks in String to Minimize Its ValueMedium3085Minimum Deletions to Make String K-SpecialMedium3086Minimum Moves to Pick K OnesHard3091Apply Operations to Make Sum of Array Greater Than or Equal to kMedium3106Lexicographically Smallest String After Operations With ConstraintMedium3107Minimum Operations to Make Median of Array Equal to KMedium3111Minimum Rectangles to Cover PointsMedium3139Minimum Cost to Equalize ArrayHard3170Lexicographically Minimum String After Removing StarsMedium3192Minimum Operations to Make Binary Array Elements Equal to One IIMedium3207Maximum Points After Enemy BattlesMedium3216Lexicographically Smallest String After a SwapEasy3218Minimum Cost for Cutting Cake IMedium3219Minimum Cost for Cutting Cake IIHard3228Maximum Number of Operations to Move Ones to the EndMedium3229Minimum Operations to Make Array Equal to TargetHard3244Shortest Distance After Road Addition Queries IIHard3260Find the Largest Palindrome Divisible by KHard3273Minimum Amount of Damage Dealt to BobHard3281Maximize Score of Numbers in RangesMedium3282Reach End of Array With Max ScoreMedium3296Minimum Number of Seconds to Make Mountain Height ZeroMedium3301Maximize the Total Height of Unique TowersMedium3302Find the Lexicographically Smallest Valid SequenceMedium3326Minimum Division Operations to Make Array Non DecreasingMedium3348Smallest Divisible Digit Product IIHard3357Minimize the Maximum Adjacent Element DifferenceHard3362Zero Array Transformation IIIMedium3397Maximum Number of Distinct Elements After OperationsMedium3402Minimum Operations to Make Columns Strictly IncreasingEasy3413Maximum Coins From K Consecutive BagsMedium3424Minimum Cost to Make Arrays IdenticalMedium3434Maximum Frequency After Subarray OperationMedium3439Reschedule Meetings for Maximum Free Time IMedium3440Reschedule Meetings for Maximum Free Time IIMedium3449Maximize the Minimum Game ScoreHard3457Eat Pizzas!Medium3458Select K Disjoint Special SubstringsMedium3462Maximum Sum With at Most K ElementsMedium3464Maximize the Distance Between Points on a SquareHard3474Lexicographically Smallest Generated StringHard3487Maximum Unique Subarray Sum After DeletionEasy3523Make Array Non-decreasingMedium3534Path Existence Queries in a Graph IIHard3542Minimum Operations to Convert All Elements to ZeroMedium3545Minimum Deletions for At Most K Distinct CharactersEasy3547Maximum Sum of Edge Values in a GraphHard3557Find Maximum Number of Non Intersecting SubstringsMedium3572Maximize Y‑Sum by Picking a Triplet of Distinct X‑ValuesMedium3576Transform Array to All Equal ElementsMedium3579Minimum Steps to Convert String with OperationsHard3587Minimum Adjacent Swaps to Alternate ParityMedium3588Find Maximum Area of a TriangleMedium3600Maximize Spanning Tree Stability with UpgradesHard3605Minimum Stability Factor of ArrayHard3630Partition Array for Maximum XOR and ANDHard
← 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.