Greedy Algorithms
Advanced & DPMaking locally optimal choices that guarantee global optimal outcomes
410 problems·43 Easy·277 Medium·90 Hard
Pattern Study Guide & Cheat Sheet▼
Make the locally optimal choice at each decision step with the mathematical guarantee that it leads to the globally optimal solution without backtracking.
Core Invariant: Greedy Choice Property: Can you prove by exchange argument that swapping a greedy decision with any alternative never produces a superior outcome? If yes, greedy holds.
Recognize it (Keywords & Signals)
- Maximize profit / minimize cost with independent sequential choices
- Jump game (maximum reachable index)
- Gas station circuit / circular route
- Task scheduler / candy distribution
- Minimum arrows to burst balloons
When NOT to use
Local decisions constrain future options in conflicting ways (e.g. 0/1 Knapsack, Coin Change with arbitrary denominations; must use DP!).
How to solve (Step-by-step)
- 1.Identify the greedy metric (e.g. earliest finish time, farthest reach, max profit step).
- 2.Sort inputs if necessary to enforce the greedy ordering.
- 3.Maintain a single state variable (e.g., `farthest_reach = 0`, `current_gas = 0`).
- 4.Iterate through elements and update state irreversibly.
- 5.Return final accumulated score or boolean feasibility.
Watch for (Interview Traps)
- Assuming greedy works without proof (e.g. Coin Change fails for denominations [1, 3, 4] with target 6)
- Premature optimization: always verify if dynamic programming is required before committing to greedy
- Failing to check if starting point is unreachable in Jump Game
Farthest Reach Greedy (Jump Game)
def can_jump(nums: list[int]) -> bool:
farthest = 0
for i, jump in enumerate(nums):
# If current index is beyond the farthest reach, we cannot proceed
if i > farthest:
return False
# Update maximum index we can reach
farthest = max(farthest, i + jump)
if farthest >= len(nums) - 1:
return True
return True- Cost
- O(n) single pass or O(n log n) with sorting · O(1) auxiliary space (Extremely memory efficient when greedy choice property holds.)
Canonical problems
#55 Jump Game: Greedily extend farthest reachable milestone
#45 Jump Game II: Count jumps whenever current step boundary is reached
#134 Gas Station: If total gas >= total cost, start right after the worst deficit point
#621 Task Scheduler: Most frequent task forms idle slot framework
⌘K
#179Largest Number
Medium·23 companies·Max freq 100%·Acc 43.3%
Josh TechnologyWorks ApplicationsGraviton+20
Medium·16 companies·Max freq 100%·Acc 39.0%
GopuffVisaPayPal+13
Hard·13 companies·Max freq 100%·Acc 51.0%
Akuna CapitalDE ShawMeesho+10
Medium·13 companies·Max freq 69%·Acc 78.0%
MicrostrategyServiceNowVisa+10
Medium·12 companies·Max freq 100%·Acc 45.0%
Pony.aiPony.aiUrban Company+9
Hard·11 companies·Max freq 100%·Acc 70.2%
WinZOPhonePeLyft+8
Medium·11 companies·Max freq 100%·Acc 62.2%
Tower Research CapitalTower Research CapitalNagarro+8
Medium·9 companies·Max freq 100%·Acc 38.4%
LiveRampeBayTikTok+6
Medium·9 companies·Max freq 100%·Acc 63.7%
FactSetByteDancePaytm+6
Medium·9 companies·Max freq 55%·Acc 72.3%
AppleCitadelTikTok+6
#1323Maximum 69 Number
Easy·8 companies·Max freq 100%·Acc 84.6%
Hudson River TradingHSBCHudson River Trading+5
Medium·8 companies·Max freq 100%·Acc 47.2%
MathWorksSquarepoint CapitalExpedia+5
Medium·8 companies·Max freq 100%·Acc 62.8%
Salesforce6senseNvidia+5
Medium·8 companies·Max freq 100%·Acc 61.7%
LivspaceZohoTikTok+5
Medium·8 companies·Max freq 80%·Acc 45.2%
MolocoServiceNowExpedia+5
Hard·8 companies·Max freq 67%·Acc 78.2%
Dream11GoogleSprinklr+5
Medium·7 companies·Max freq 100%·Acc 51.0%
FlexeraSalesforceAmazon+4
Medium·7 companies·Max freq 100%·Acc 61.5%
American ExpresssmartnewsGeneral Motors+4
Medium·7 companies·Max freq 100%·Acc 60.7%
CourseraZScalerPayPal+4
Medium·7 companies·Max freq 100%·Acc 51.8%
Pony.aiPublicis SapientPony.ai+4
Medium·7 companies·Max freq 88%·Acc 63.6%
AdobeWalmart LabsIBM+4
Medium·7 companies·Max freq 75%·Acc 57.0%
DE ShawGoldman SachsAmazon+4
Hard·7 companies·Max freq 63%·Acc 0.6%
CitadelSquarepoint CapitalPalo Alto Networks+4
Medium·7 companies·Max freq 63%·Acc 66.4%
SwiggyJuspayGoogle+4
Medium·6 companies·Max freq 100%·Acc 80.2%
DirectiGoogleMicrosoft+3
Medium·6 companies·Max freq 100%·Acc 30.3%
GrouponMathWorksGoldman Sachs+3
Hard·6 companies·Max freq 100%·Acc 56.4%
Deutsche BankCapital OneGoogle+3
Medium·6 companies·Max freq 100%·Acc 51.0%
NaviZeta GlobalGoogle+3
Medium·6 companies·Max freq 100%·Acc 55.9%
MercariCitadelAtlassian+3
Easy·6 companies·Max freq 100%·Acc 73.0%
Morgan StanleyInfosysBloomberg+3
Medium·6 companies·Max freq 100%·Acc 48.7%
TrexquantMercariBloomberg+3
Hard·6 companies·Max freq 100%·Acc 58.1%
DP worldDrawbridgeMicrosoft+3
Medium·6 companies·Max freq 100%·Acc 0.6%
SiemensAmazonGoogle+3
Medium·6 companies·Max freq 100%·Acc 64.1%
McKinseyVisaTikTok+3
Easy·6 companies·Max freq 100%·Acc 0.8%
eLitmusSnapSnap+3
Hard·6 companies·Max freq 91%·Acc 53.1%
ExpediaZScalerMoveworks+3
Medium·6 companies·Max freq 88%·Acc 0.4%
DisneyTikTokIBM+3
Medium·6 companies·Max freq 88%·Acc 40.9%
VerilyGoogleGoldman Sachs+3
Medium·6 companies·Max freq 75%·Acc 87.5%
RobloxMetaAmazon+3
Medium·6 companies·Max freq 65%·Acc 74.8%
PhonePeMedia.netMedia.net+3
Medium·6 companies·Max freq 63%·Acc 53.5%
DatabricksBloombergGoogle+3
Easy·6 companies·Max freq 63%·Acc 48.6%
InfosysMicrosoftMeta+3
Medium·6 companies·Max freq 50%·Acc 79.0%
SalesforceGoogleBloomberg+3
Hard·6 companies·Max freq 41%·Acc 54.8%
PayPalMicrosoftBloomberg+3
Medium·5 companies·Max freq 100%·Acc 70.8%
Arista NetworksFortinetJPMorgan Chase+2
Easy·5 companies·Max freq 100%·Acc 71.6%
GarminNokiaAmazon+2
Hard·5 companies·Max freq 100%·Acc 53.5%
BarclaysTikTokAmazon+2
Medium·5 companies·Max freq 100%·Acc 65.9%
Bill.comExpediaNvidia+2
Easy·5 companies·Max freq 100%·Acc 54.1%
DruvaInfosysUber+2
Easy·5 companies·Max freq 100%·Acc 82.2%
Deutsche BankTikTokAmazon+2
Hard·5 companies·Max freq 100%·Acc 76.5%
Akuna CapitalGoldman SachsMicrosoft+2
#2939Maximum Xor Product
Medium·5 companies·Max freq 94%·Acc 30.2%
Squarepoint CapitalZomatoRippling+2
Hard·5 companies·Max freq 88%·Acc 44.9%
SoFiLinkedInOracle+2
Hard·5 companies·Max freq 88%·Acc 50.0%
Walmart LabsAmazonMeta+2
Hard·5 companies·Max freq 88%·Acc 0.5%
AccentureGoogleMicrosoft+2
Medium·5 companies·Max freq 88%·Acc 0.6%
FlipkartAmazonBloomberg+2
Medium·5 companies·Max freq 88%·Acc 68.9%
AdobeAccoliteTikTok+2
Easy·5 companies·Max freq 75%·Acc 71.7%
VisaBloombergGoogle+2
Medium·5 companies·Max freq 75%·Acc 50.2%
MathWorksSquarepoint CapitalSalesforce+2
Easy·5 companies·Max freq 63%·Acc 87.5%
SalesforceInfosysAmazon+2
Easy·5 companies·Max freq 52%·Acc 42.9%
TuringMicrosoftAmazon+2
Hard·5 companies·Max freq 50%·Acc 53.0%
RubrikIBMMicrosoft+2
Easy·5 companies·Max freq 25%·Acc 40.5%
MicrosoftBloombergMeta+2
Medium·4 companies·Max freq 100%·Acc 41.5%
BNY MellonIXLExpedia+1
Medium·4 companies·Max freq 100%·Acc 90.5%
NutanixZohoAmazon+1
Easy·4 companies·Max freq 100%·Acc 20.6%
ZendeskGustoApple+1
Hard·4 companies·Max freq 100%·Acc 69.4%
Deutsche BankBlackRockMeta+1
Medium·4 companies·Max freq 100%·Acc 36.1%
BNY MellonDTCCHashedIn+1
Medium·4 companies·Max freq 100%·Acc 68.4%
PhonePeAmazonBloomberg+1
Hard·4 companies·Max freq 100%·Acc 61.5%
TeradataAmazonGoogle+1
Medium·4 companies·Max freq 91%·Acc 51.9%
HPJuspayGoldman Sachs+1
Medium·4 companies·Max freq 88%·Acc 67.9%
MathWorksPhonePeBloomberg+1
Medium·4 companies·Max freq 88%·Acc 67.3%
DuolingoAmazonBloomberg+1
Hard·4 companies·Max freq 75%·Acc 0.6%
BNY MellonInMobiTekion+1
Hard·4 companies·Max freq 67%·Acc 42.4%
TuringMicrosoftGoogle+1
Medium·4 companies·Max freq 63%·Acc 35.2%
IBMAgodaGoldman Sachs+1
Easy·4 companies·Max freq 54%·Acc 81.5%
MathWorksPayPalMeta+1
Medium·4 companies·Max freq 50%·Acc 31.4%
AmazonBloombergMicrosoft+1
Medium·4 companies·Max freq 28%·Acc 56.5%
GoogleAmazonMeta+1
Medium·4 companies·Max freq 27%·Acc 69.1%
AmazonBloombergMicrosoft+1
Medium·4 companies·Max freq 26%·Acc 52.3%
GoogleMetaAmazon+1
Medium·4 companies·Max freq 25%·Acc 67.1%
GoogleMetaAmazon+1
Medium·4 companies·Max freq 25%·Acc 75.4%
AmazonMetaGoogle+1
Medium·4 companies·Max freq 25%·Acc 60.4%
GoogleBloombergAmazon+1
Medium·4 companies·Max freq 21%·Acc 0.6%
BloombergGoogleMeta+1
Medium·4 companies·Max freq 18%·Acc 53.1%
BloombergMetaAmazon+1
Easy·4 companies·Max freq 16%·Acc 73.0%
AmazonBloombergMeta+1
Medium·3 companies·Max freq 100%·Acc 48.5%
GrabGeicoPalo Alto Networks
Medium·3 companies·Max freq 100%·Acc 35.6%
DRWRetailMeNotMicrosoft
Medium·3 companies·Max freq 100%·Acc 0.4%
observe.aiMorgan StanleyAmazon
Medium·3 companies·Max freq 100%·Acc 51.2%
tokopediaMicrosoftGoogle
Medium·3 companies·Max freq 100%·Acc 63.1%
YelpUnityMathWorks
Medium·3 companies·Max freq 92%·Acc 36.1%
LTIMindtreeGoogleAmazon
Medium·3 companies·Max freq 88%·Acc 42.6%
NatWestWells FargoAmazon
Medium·3 companies·Max freq 84%·Acc 33.4%
FlipkartMetaMicrosoft
Medium·3 companies·Max freq 75%·Acc 67.1%
DE ShawBloombergGoogle
Medium·3 companies·Max freq 75%·Acc 32.0%
DE ShawBloombergGoogle
Medium·3 companies·Max freq 75%·Acc 38.8%
InfosysMetaAmazon
Medium·3 companies·Max freq 65%·Acc 52.4%
PhonePeGoogleAmazon
Medium·3 companies·Max freq 62%·Acc 69.2%
NeetCode 150NeetCode 150Google
Medium·3 companies·Max freq 60%·Acc 0.5%
NutanixMicrosoftOracle
Medium·3 companies·Max freq 44%·Acc 85.5%
Goldman SachsAmazonGoogle
Medium·3 companies·Max freq 38%·Acc 65.2%
MicrosoftAmazonBloomberg
Hard·3 companies·Max freq 29%·Acc 41.8%
MicrosoftAmazonGoogle
Medium·3 companies·Max freq 25%·Acc 58.7%
AmazonMicrosoftGoogle
Medium·3 companies·Max freq 25%·Acc 52.8%
BloombergGoogleAmazon
Medium·3 companies·Max freq 13%·Acc 53.6%
MetaAmazonGoogle
Medium·3 companies·Max freq 13%·Acc 58.3%
MetaAmazonGoogle
Easy·3 companies·Max freq 13%·Acc 87.2%
MetaAmazonGoogle
Hard·3 companies·Max freq 13%·Acc 66.2%
AmazonMicrosoftGoogle
Easy·2 companies·Max freq 100%·Acc 0.7%
Virtu FinancialVirtu Financial
Hard·2 companies·Max freq 100%·Acc 20.7%
PaytmMeta
Medium·2 companies·Max freq 100%·Acc 44.7%
ArcesiumAmazon
Hard·2 companies·Max freq 100%·Acc 41.4%
razorpayAmazon
Medium·2 companies·Max freq 100%·Acc 0.7%
Hudson River TradingHudson River Trading
Medium·2 companies·Max freq 100%·Acc 44.5%
ZScalerTuring
Hard·2 companies·Max freq 100%·Acc 65.5%
VMwareGoogle
Easy·2 companies·Max freq 100%·Acc 74.0%
MercariAmazon
Medium·2 companies·Max freq 100%·Acc 44.0%
Societe GeneraleAmazon
Medium·2 companies·Max freq 100%·Acc 53.4%
GeicoMicrosoft
Medium·2 companies·Max freq 90%·Acc 62.5%
SamsungAmazon
Hard·2 companies·Max freq 88%·Acc 61.4%
Walmart LabsAmazon
Medium·2 companies·Max freq 76%·Acc 68.0%
PayPalBloomberg
Medium·2 companies·Max freq 75%·Acc 37.5%
PayPalAmazon
Medium·2 companies·Max freq 63%·Acc 82.6%
Squarepoint CapitalGoogle
Medium·2 companies·Max freq 63%·Acc 59.5%
WaymoGoogle
Easy·2 companies·Max freq 50%·Acc 73.9%
AmazonGoogle
Medium·2 companies·Max freq 29%·Acc 35.8%
AmazonBloomberg
Medium·2 companies·Max freq 28%·Acc 81.8%
AmazonGoogle
Medium·2 companies·Max freq 27%·Acc 59.2%
GoogleAmazon
Medium·2 companies·Max freq 27%·Acc 33.5%
AmazonGoogle
Easy·2 companies·Max freq 25%·Acc 73.2%
MetaGoogle
Medium·2 companies·Max freq 25%·Acc 71.9%
GoogleMeta
Medium·2 companies·Max freq 25%·Acc 62.2%
AmazonMeta
Medium·2 companies·Max freq 25%·Acc 73.1%
AmazonGoogle
Medium·2 companies·Max freq 18%·Acc 26.9%
AmazonGoogle
Medium·2 companies·Max freq 16%·Acc 64.3%
GoogleAmazon
Medium·2 companies·Max freq 13%·Acc 47.8%
MetaGoogle
Medium·2 companies·Max freq 13%·Acc 29.4%
AmazonGoogle
Medium·2 companies·Max freq 13%·Acc 48.1%
AmazonGoogle
Medium·1 companies·Max freq 100%·Acc 24.1%
American Express
Medium·1 companies·Max freq 100%·Acc 54.7%
American Express
Medium·1 companies·Max freq 100%·Acc 36.3%
Fleetx
Medium·1 companies·Max freq 100%·Acc 62.9%
ServiceNow
Hard·1 companies·Max freq 100%·Acc 40.0%
Deutsche Bank
Hard·1 companies·Max freq 90%·Acc 44.9%
Sprinklr
Medium·1 companies·Max freq 88%·Acc 40.8%
Adobe
Medium·1 companies·Max freq 83%·Acc 32.1%
DE Shaw
Medium·1 companies·Max freq 75%·Acc 35.0%
PayPal
Medium·1 companies·Max freq 75%·Acc 48.1%
IBM
Medium·1 companies·Max freq 75%·Acc 61.0%
Infosys
Medium·1 companies·Max freq 75%·Acc 64.3%
Infosys
Medium·1 companies·Max freq 75%·Acc 34.9%
Infosys
Easy·1 companies·Max freq 70%·Acc 72.8%
IBM
Hard·1 companies·Max freq 63%·Acc 41.6%
HashedIn
Medium·1 companies·Max freq 63%·Acc 70.0%
Salesforce
Medium·1 companies·Max freq 50%·Acc 50.9%
Uber
Medium·1 companies·Max freq 50%·Acc 65.3%
Uber
Medium·1 companies·Max freq 38%·Acc 31.4%
Amazon
Medium·1 companies·Max freq 25%·Acc 63.5%
Amazon
Medium·1 companies·Max freq 25%·Acc 55.0%
Amazon
Medium·1 companies·Max freq 25%·Acc 29.4%
Amazon
Medium·1 companies·Max freq 25%·Acc 25.4%
Amazon
Medium·1 companies·Max freq 25%·Acc 62.8%
Amazon
Hard·1 companies·Max freq 25%·Acc 30.5%
Google
Medium·1 companies·Max freq 25%·Acc 65.0%
Google
Medium·1 companies·Max freq 25%·Acc 49.1%
Google
Hard·1 companies·Max freq 25%·Acc 51.7%
Google
Medium·1 companies·Max freq 25%·Acc 64.0%
Google
Medium·1 companies·Max freq 13%·Acc 31.1%
Bloomberg
# | Problem | Difficulty | Top Companies↓ | Frequency | Acceptance | |
|---|---|---|---|---|---|---|
| #11 | Container With Most Water ArrayTwo PointersGreedy | Medium | 100% | 60.4% | ||
| #253 | Meeting Rooms II ArrayTwo PointersGreedySortingHeap (Priority Queue)Prefix Sum | Medium | 100% | 52.7% | ||
| #55 | Jump Game ArrayDynamic ProgrammingGreedy | Medium | 100% | 41.2% | ||
| #134 | Gas Station ArrayGreedy | Medium | 100% | 48.3% | ||
| #45 | Jump Game II ArrayDynamic ProgrammingGreedy | Medium | 100% | 43.1% | ||
| #621 | Task Scheduler ArrayHash TableGreedySortingHeap (Priority Queue)Counting | Medium | 100% | 63.4% | ||
| #135 | Candy ArrayGreedy | Hard | 100% | 48.8% | ||
| #179 | Largest Number ArrayStringGreedySorting | Medium | 100% | 43.3% | ||
| #410 | Split Array Largest Sum ArrayBinary SearchDynamic ProgrammingGreedyPrefix Sum | Hard | 100% | 60.9% | ||
| #435 | Non-overlapping Intervals ArrayDynamic ProgrammingGreedySorting | Medium | 88% | 57.4% | ||
| #767 | Reorganize String Hash TableStringGreedySortingHeap (Priority Queue)Counting | Medium | 100% | 57.3% | ||
| #678 | Valid Parenthesis String StringDynamic ProgrammingStackGreedyBracket Sequences | Medium | 100% | 40.3% | ||
| #44 | Wildcard Matching StringDynamic ProgrammingGreedyRecursion | Hard | 100% | 32.3% | ||
| #605 | Can Place Flowers ArrayGreedy | Easy | 100% | 29.2% | ||
| #680 | Valid Palindrome II Two PointersStringGreedy | Easy | 100% | 44.5% | ||
| #1353 | Maximum Number of Events That Can Be Attended ArrayGreedySortingHeap (Priority Queue) | Medium | 100% | 39.0% | ||
| #316 | Remove Duplicate Letters StringStackGreedyMonotonic Stack | Medium | 100% | 0.5% | ||
| #1326 | Minimum Number of Taps to Open to Water a Garden ArrayDynamic ProgrammingGreedy | Hard | 100% | 51.0% | ||
| #881 | Boats to Save People ArrayTwo PointersGreedySortingTimsort | Medium | 80% | 0.6% | ||
| #1963 | Minimum Number of Swaps to Make the String Balanced Two PointersStringStackGreedyBracket Sequences | Medium | 69% | 78.0% | ||
| #1838 | Frequency of the Most Frequent Element ArrayBinary SearchGreedySliding WindowSortingPrefix Sum | Medium | 100% | 45.0% | ||
| #723 | Candy Crush ArrayTwo PointersMatrixSimulation | Medium | 100% | 77.6% | ||
| #632 | Smallest Range Covering Elements from K Lists ArrayHash TableGreedySliding WindowSortingHeap (Priority Queue) | Hard | 100% | 70.2% | ||
| #2434 | Using a Robot to Print the Lexicographically Smallest String Hash TableStringStackGreedy | Medium | 100% | 62.2% | ||
| #763 | Partition Labels Hash TableTwo PointersStringGreedy | Medium | 67% | 82.0% | ||
| #611 | Valid Triangle Number ArrayTwo PointersBinary SearchGreedySorting | Medium | 100% | 57.0% | ||
| #581 | Shortest Unsorted Continuous Subarray ArrayTwo PointersStackGreedySortingMonotonic Stack | Medium | 100% | 38.4% | ||
| #1081 | Smallest Subsequence of Distinct Characters StringStackGreedyMonotonic Stack | Medium | 100% | 63.7% | ||
| #502 | IPO ArrayGreedySortingHeap (Priority Queue) | Hard | 88% | 53.6% | ||
| #670 | Maximum Swap MathGreedy | Medium | 75% | 52.1% | ||
| #455 | Assign Cookies ArrayTwo PointersGreedySortingQuicksort | Easy | 63% | 55.3% | ||
| #860 | Lemonade Change ArrayGreedy | Easy | 63% | 59.3% | ||
| #714 | Best Time to Buy and Sell Stock with Transaction Fee ArrayDynamic ProgrammingGreedy | Medium | 55% | 72.3% | ||
| #2561 | Rearranging Fruits ArrayHash TableGreedySort | Hard | 41% | 57.3% | ||
| #409 | Longest Palindrome Hash TableStringGreedy | Easy | 100% | 56.1% | ||
| #781 | Rabbits in Forest ArrayHash TableMathGreedy | Medium | 100% | 58.0% | ||
| #1323 | Maximum 69 Number MathGreedy | Easy | 100% | 84.6% | ||
| #3035 | Maximum Palindromes After Operations ArrayHash TableStringGreedySortingCounting | Medium | 100% | 47.2% | ||
| #2571 | Minimum Operations to Reduce an Integer to 0 Dynamic ProgrammingGreedyBit Manipulation | Medium | 100% | 62.8% | ||
| #1405 | Longest Happy String StringGreedyHeap (Priority Queue) | Medium | 100% | 65.5% | ||
| #452 | Minimum Number of Arrows to Burst Balloons ArrayGreedySorting | Medium | 100% | 61.7% | ||
| #420 | Strong Password Checker StringGreedyHeap (Priority Queue) | Hard | 88% | 16.0% | ||
| #2116 | Check if a Parentheses String Can Be Valid StringStackGreedyBracket Sequences | Medium | 80% | 45.2% | ||
| #871 | Minimum Number of Refueling Stops ArrayDynamic ProgrammingGreedyHeap (Priority Queue) | Hard | 79% | 41.6% | ||
| #1526 | Minimum Number of Increments on Subarrays to Form a Target Array ArrayDynamic ProgrammingStackGreedyMonotonic Stack | Hard | 67% | 78.2% | ||
| #321 | Create Maximum Number ArrayTwo PointersStackGreedyMonotonic Stack | Hard | 64% | 0.4% | ||
| #846 | Hand of Straights ArrayHash TableGreedySorting | Medium | 62% | 58.2% | ||
| #2551 | Put Marbles in Bags ArrayGreedySortingHeap (Priority Queue) | Hard | 50% | 72.1% | ||
| #2560 | House Robber IV ArrayBinary SearchDynamic ProgrammingGreedy | Medium | 100% | 64.6% | ||
| #3170 | Lexicographically Minimum String After Removing Stars Hash TableStringStackGreedyHeap (Priority Queue) | Medium | 100% | 51.0% | ||
| #888 | Fair Candy Swap ArrayHash TableBinary SearchSorting | Easy | 100% | 65.3% | ||
| #1696 | Jump Game VI ArrayDynamic ProgrammingQueueHeap (Priority Queue)Monotonic Queue | Medium | 100% | 46.5% | ||
| #1647 | Minimum Deletions to Make Character Frequencies Unique Hash TableStringGreedySorting | Medium | 100% | 61.5% | ||
| #945 | Minimum Increment to Make Array Unique ArrayGreedySortingCounting | Medium | 100% | 60.7% | ||
| #1824 | Minimum Sideway Jumps ArrayDynamic ProgrammingGreedy | Medium | 100% | 51.8% | ||
| #2592 | Maximize Greatness of an Array ArrayTwo PointersGreedySorting | Medium | 100% | 61.9% | ||
| #2406 | Divide Intervals Into Minimum Number of Groups ArrayTwo PointersGreedySortingHeap (Priority Queue)Prefix Sum | Medium | 88% | 63.6% | ||
| #334 | Increasing Triplet Subsequence ArrayGreedyLongest Increasing Subsequence | Medium | 80% | 39.5% | ||
| #769 | Max Chunks To Make Sorted ArrayStackGreedySortingMonotonic Stack | Medium | 77% | 64.2% | ||
| #1262 | Greatest Sum Divisible by Three ArrayDynamic ProgrammingGreedySorting | Medium | 75% | 57.0% | ||
| #921 | Minimum Add to Make Parentheses Valid StringStackGreedyBracket Sequences | Medium | 75% | 74.3% | ||
| #765 | Couples Holding Hands GreedyDepth-First SearchBreadth-First SearchUnion-FindGraph Theory | Hard | 63% | 0.6% | ||
| #1717 | Maximum Score From Removing Substrings StringStackGreedy | Medium | 63% | 66.4% | ||
| #1328 | Break a Palindrome StringGreedy | Medium | 100% | 51.6% | ||
| #1727 | Largest Submatrix With Rearrangements ArrayGreedySortingMatrix | Medium | 100% | 80.2% | ||
| #1648 | Sell Diminishing-Valued Colored Balls ArrayMathBinary SearchGreedySortingHeap (Priority Queue) | Medium | 100% | 30.3% | ||
| #2141 | Maximum Running Time of N Computers ArrayBinary SearchGreedySorting | Hard | 100% | 56.4% | ||
| #2616 | Minimize the Maximum Difference of Pairs ArrayBinary SearchDynamic ProgrammingGreedySorting | Medium | 100% | 51.0% | ||
| #2598 | Smallest Missing Non-negative Integer After Operations ArrayHash TableMathGreedy | Medium | 100% | 55.9% | ||
| #649 | Dota2 Senate StringGreedyQueue | Medium | 100% | 50.2% | ||
| #1488 | Avoid Flood in The City ArrayHash TableBinary SearchGreedyHeap (Priority Queue) | Medium | 100% | 39.0% | ||
| #1217 | Minimum Cost to Move Chips to The Same Position ArrayMathGreedy | Easy | 100% | 73.0% | ||
| #1432 | Medium | 100% | 48.7% | |||
| #757 | Set Intersection Size At Least Two ArrayGreedySorting | Hard | 100% | 58.1% | ||
| #630 | Course Schedule III ArrayGreedySortingHeap (Priority Queue) | Hard | 100% | 41.9% | ||
| #2064 | Minimized Maximum of Products Distributed to Any Store ArrayBinary SearchGreedy | Medium | 100% | 0.6% | ||
| #2530 | Maximal Score After Applying K Operations ArrayGreedyHeap (Priority Queue) | Medium | 100% | 64.1% | ||
| #3014 | Minimum Number of Pushes to Type Word I MathStringGreedy | Easy | 100% | 0.8% | ||
| #2366 | Minimum Replacements to Sort the Array ArrayMathGreedy | Hard | 91% | 53.1% | ||
| #1877 | Minimize Maximum Pair Sum in Array ArrayTwo PointersGreedySorting | Medium | 89% | 83.3% | ||
| #1802 | Maximum Value at a Given Index in a Bounded Array MathBinary SearchGreedy | Medium | 88% | 0.4% | ||
| #2007 | Find Original Array From Doubled Array ArrayHash TableGreedySorting | Medium | 88% | 40.9% | ||
| #2429 | Minimize XOR GreedyBit Manipulation | Medium | 88% | 62.4% | ||
| #1975 | Maximum Matrix Sum ArrayGreedyMatrix | Medium | 77% | 67.5% | ||
| #2542 | Maximum Subsequence Score ArrayGreedySortingHeap (Priority Queue) | Medium | 75% | 54.8% | ||
| #1282 | Group the People Given the Group Size They Belong To ArrayHash TableGreedy | Medium | 75% | 87.5% | ||
| #2448 | Minimum Cost to Make Array Equal ArrayBinary SearchGreedySortingPrefix Sum | Hard | 75% | 46.8% | ||
| #2365 | Task Scheduler II ArrayHash TableSimulation | Medium | 68% | 54.9% | ||
| #406 | Medium | 65% | 74.8% | |||
| #2131 | Longest Palindrome by Concatenating Two Letter Words ArrayHash TableStringGreedyCounting | Medium | 63% | 53.5% | ||
| #1029 | Two City Scheduling ArrayGreedySortingHungarian AlgorithmSuccessive Shortest Path Algorithm | Medium | 63% | 68.7% | ||
| #2259 | Remove Digit From Number to Maximize Result StringGreedyEnumeration | Easy | 63% | 48.6% | ||
| #1400 | Construct K Palindrome Strings Hash TableStringGreedyCounting | Medium | 50% | 68.5% | ||
| #2966 | Divide Array Into Arrays With Max Difference ArrayGreedySorting | Medium | 50% | 79.0% | ||
| #1671 | Minimum Number of Removals to Make Mountain Array ArrayBinary SearchDynamic ProgrammingGreedy | Hard | 41% | 54.8% | ||
| #1903 | Largest Odd Number in String MathStringGreedy | Easy | 41% | 67.8% | ||
| #2182 | Construct String With Repeat Limit Hash TableStringGreedyHeap (Priority Queue)Counting | Medium | 100% | 70.8% | ||
| #991 | Broken Calculator MathGreedy | Medium | 100% | 56.3% | ||
| #2144 | Minimum Cost of Buying Candies With Discount ArrayGreedySorting | Easy | 100% | 71.6% | ||
| #826 | Most Profit Assigning Work ArrayTwo PointersBinary SearchGreedySorting | Medium | 100% | 56.3% | ||
| #397 | Integer Replacement Dynamic ProgrammingGreedyBit ManipulationMemoization | Medium | 100% | 0.4% | ||
| #3474 | Lexicographically Smallest Generated String StringGreedyString Matching | Hard | 100% | 53.5% | ||
| #1962 | Remove Stones to Minimize the Total ArrayGreedyHeap (Priority Queue) | Medium | 100% | 65.9% | ||
| #1005 | Maximize Sum Of Array After K Negations ArrayGreedySorting | Easy | 100% | 54.1% | ||
| #2439 | Minimize Maximum of Array ArrayBinary SearchDynamic ProgrammingGreedyPrefix Sum | Medium | 100% | 46.6% | ||
| #1827 | Easy | 100% | 82.2% | |||
| #1665 | Minimum Initial Energy to Finish Tasks ArrayGreedySorting | Hard | 100% | 76.5% | ||
| #2939 | Maximum Xor Product MathGreedyBit Manipulation | Medium | 94% | 30.2% | ||
| #324 | Wiggle Sort II ArrayDivide and ConquerGreedySortingQuickselect | Medium | 89% | 0.4% | ||
| #1386 | Cinema Seat Allocation ArrayHash TableGreedyBit Manipulation | Medium | 88% | 44.7% | ||
| #3660 | Medium | 88% | 46.3% | |||
| #2472 | Maximum Number of Non-overlapping Palindrome Substrings Two PointersStringDynamic ProgrammingGreedy | Hard | 88% | 44.9% | ||
| #2071 | Maximum Number of Tasks You Can Assign ArrayTwo PointersBinary SearchGreedyQueueSortingMonotonic Queue | Hard | 88% | 50.0% | ||
| #3348 | Smallest Divisible Digit Product II MathStringBacktrackingGreedyNumber Theory | Hard | 88% | 0.5% | ||
| #2952 | Minimum Number of Coins to be Added ArrayGreedySorting | Medium | 88% | 0.6% | ||
| #2422 | Merge Operations to Turn Array Into a Palindrome ArrayTwo PointersGreedy | Medium | 88% | 68.9% | ||
| #527 | Word Abbreviation ArrayStringGreedyTrieSorting | Hard | 88% | 0.6% | ||
| #976 | Largest Perimeter Triangle ArrayMathGreedySortingQuicksortPolygons | Easy | 75% | 62.3% | ||
| #2078 | Two Furthest Houses With Different Colors ArrayGreedy | Easy | 75% | 71.7% | ||
| #2918 | Medium | 75% | 50.2% | |||
| #1221 | Split a String in Balanced Strings StringGreedyCounting | Easy | 63% | 87.5% | ||
| #1345 | Jump Game IV ArrayHash TableBreadth-First Search | Hard | 59% | 51.0% | ||
| #1013 | Easy | 52% | 42.9% | |||
| #2193 | Minimum Number of Moves to Make Palindrome Two PointersStringGreedyBinary Indexed Tree | Hard | 50% | 53.0% | ||
| #1382 | Balance a Binary Search Tree Divide and ConquerGreedyTreeDepth-First SearchBinary Search TreeBinary Tree | Medium | 38% | 86.3% | ||
| #1792 | Maximum Average Pass Ratio ArrayGreedyHeap (Priority Queue) | Medium | 38% | 74.1% | ||
| #561 | Array Partition ArrayGreedySortingCounting Sort | Easy | 30% | 81.9% | ||
| #3362 | Zero Array Transformation III ArrayTwo PointersGreedySortingHeap (Priority Queue)Prefix Sum | Medium | 28% | 54.7% | ||
| #768 | Max Chunks To Make Sorted II ArrayStackGreedySortingMonotonic Stack | Hard | 28% | 55.0% | ||
| #1833 | Maximum Ice Cream Bars ArrayGreedySortingCounting Sort | Medium | 25% | 77.2% | ||
| #3487 | Maximum Unique Subarray Sum After Deletion ArrayHash TableGreedy | Easy | 25% | 40.5% | ||
| #1465 | Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts ArrayGreedySorting | Medium | 100% | 41.5% | ||
| #2895 | Minimum Processing Time ArrayGreedySorting | Medium | 100% | 70.6% | ||
| #1689 | Medium | 100% | 90.5% | |||
| #2591 | Distribute Money to Maximum Children MathGreedy | Easy | 100% | 20.6% | ||
| #3068 | Find the Maximum Sum of Node Values ArrayDynamic ProgrammingGreedyBit ManipulationTreeSorting | Hard | 100% | 69.4% | ||
| #3012 | Minimize Length of Array Using Operations ArrayMathGreedyNumber Theory | Medium | 100% | 36.1% | ||
| #2517 | Maximum Tastiness of Candy Basket ArrayBinary SearchGreedySorting | Medium | 100% | 68.4% | ||
| #1306 | Jump Game III ArrayDepth-First SearchBreadth-First Search | Medium | 100% | 70.3% | ||
| #2528 | Maximize the Minimum Powered City ArrayBinary SearchGreedyQueueSliding WindowPrefix Sum | Hard | 100% | 61.5% | ||
| #2087 | Minimum Cost Homecoming of a Robot in a Grid ArrayGreedy | Medium | 91% | 51.9% | ||
| #1130 | Minimum Cost Tree From Leaf Values ArrayDynamic ProgrammingStackGreedyMonotonic StackCartesian Tree | Medium | 88% | 67.9% | ||
| #1024 | Video Stitching ArrayDynamic ProgrammingGreedy | Medium | 88% | 52.8% | ||
| #1733 | Minimum Number of People to Teach ArrayHash TableGreedy | Medium | 88% | 67.3% | ||
| #3948 | Lexicographically Maximum MEX Array ArrayHash TableGreedyQueue | Hard | 75% | 0.6% | ||
| #1402 | Reducing Dishes ArrayDynamic ProgrammingGreedySorting | Hard | 69% | 76.8% | ||
| #1703 | Minimum Adjacent Swaps for K Consecutive Ones ArrayGreedySliding WindowPrefix Sum | Hard | 67% | 42.4% | ||
| #280 | Wiggle Sort ArrayGreedySorting | Medium | 63% | 68.5% | ||
| #948 | Bag of Tokens ArrayTwo PointersGreedySorting | Medium | 63% | 59.7% | ||
| #2734 | Medium | 63% | 35.2% | |||
| #358 | Rearrange String k Distance Apart Hash TableStringGreedySortingHeap (Priority Queue)Counting | Hard | 63% | 40.0% | ||
| #2697 | Lexicographically Smallest Palindrome Two PointersStringGreedy | Easy | 54% | 81.5% | ||
| #3434 | Maximum Frequency After Subarray Operation ArrayHash TableDynamic ProgrammingGreedyEnumerationPrefix Sum | Medium | 50% | 31.4% | ||
| #2405 | Optimal Partition of String Hash TableStringGreedy | Medium | 42% | 78.5% | ||
| #3689 | Maximum Total Subarray Value I ArrayGreedy | Medium | 38% | 71.9% | ||
| #1007 | Minimum Domino Rotations For Equal Row ArrayGreedy | Medium | 28% | 56.5% | ||
| #1846 | Maximum Element After Decreasing and Rearranging ArrayGreedySorting | Medium | 27% | 69.1% | ||
| #3397 | Maximum Number of Distinct Elements After Operations ArrayGreedySorting | Medium | 26% | 52.3% | ||
| #3228 | Maximum Number of Operations to Move Ones to the End StringGreedyCounting | Medium | 25% | 67.1% | ||
| #330 | Patching Array ArrayGreedy | Hard | 25% | 54.4% | ||
| #2410 | Maximum Matching of Players With Trainers ArrayTwo PointersGreedySorting | Medium | 25% | 75.4% | ||
| #1871 | Jump Game VII StringDynamic ProgrammingSliding WindowPrefix Sum | Medium | 25% | 35.6% | ||
| #2389 | Longest Subsequence With Limited Sum ArrayBinary SearchGreedySortingPrefix Sum | Easy | 25% | 73.7% | ||
| #2601 | Prime Subtraction Operation ArrayMathBinary SearchGreedyNumber Theory | Medium | 25% | 55.6% | ||
| #3440 | Reschedule Meetings for Maximum Free Time II ArrayGreedyEnumeration | Medium | 25% | 60.4% | ||
| #3302 | Find the Lexicographically Smallest Valid Sequence Two PointersStringDynamic ProgrammingGreedy | Medium | 21% | 0.6% | ||
| #3542 | Minimum Operations to Convert All Elements to Zero ArrayHash TableStackGreedyMonotonic Stack | Medium | 18% | 53.1% | ||
| #3633 | Earliest Finish Time for Land and Water Rides I ArrayTwo PointersBinary SearchGreedySorting | Easy | 16% | 73.0% | ||
| #3534 | Path Existence Queries in a Graph II ArrayTwo PointersBinary SearchDynamic ProgrammingGreedyBit ManipulationGraph TheorySorting | Hard | 15% | 64.6% | ||
| #2086 | Minimum Number of Food Buckets to Feed the Hamsters StringDynamic ProgrammingGreedy | Medium | 100% | 48.5% | ||
| #969 | Pancake Sorting ArrayTwo PointersGreedySorting | Medium | 100% | 71.9% | ||
| #2139 | Minimum Moves to Reach Target Score MathGreedy | Medium | 100% | 52.6% | ||
| #1921 | Eliminate Maximum Number of Monsters ArrayGreedySorting | Medium | 100% | 51.2% | ||
| #984 | String Without AAA or BBB StringGreedy | Medium | 100% | 45.5% | ||
| #2098 | Subsequence of Size K With the Largest Even Sum ArrayGreedySorting | Medium | 100% | 35.6% | ||
| #2384 | Largest Palindromic Number Hash TableStringGreedyCounting | Medium | 100% | 37.3% | ||
| #861 | Score After Flipping Matrix ArrayGreedyBit ManipulationMatrix | Medium | 100% | 80.3% | ||
| #2607 | Make K-Subarray Sums Equal ArrayMathGreedySortingNumber Theory | Medium | 100% | 0.4% | ||
| #2645 | Minimum Additions to Make Valid String StringDynamic ProgrammingStackGreedy | Medium | 100% | 51.2% | ||
| #2038 | Remove Colored Pieces if Both Neighbors are the Same Color MathStringGreedyGame Theory | Medium | 100% | 63.1% | ||
| #2271 | Maximum White Tiles Covered by a Carpet ArrayBinary SearchGreedySliding WindowSortingPrefix Sum | Medium | 92% | 36.1% | ||
| #1055 | Shortest Way to Form String Two PointersStringBinary SearchGreedy | Medium | 88% | 61.7% | ||
| #910 | Smallest Range II ArrayMathGreedySorting | Medium | 88% | 38.0% | ||
| #2497 | Maximum Star Sum of a Graph ArrayGreedyGraph TheorySortingHeap (Priority Queue) | Medium | 88% | 42.5% | ||
| #1953 | Medium | 88% | 42.6% | |||
| #3576 | Transform Array to All Equal Elements ArrayGreedy | Medium | 84% | 33.4% | ||
| #807 | Max Increase to Keep City Skyline ArrayGreedyMatrix | Medium | 81% | 86.5% | ||
| #870 | Advantage Shuffle ArrayTwo PointersGreedySorting | Medium | 75% | 54.8% | ||
| #3085 | Minimum Deletions to Make String K-Special Hash TableStringGreedySortingCounting | Medium | 75% | 67.1% | ||
| #2800 | Shortest String That Contains Three Strings StringGreedyEnumeration | Medium | 75% | 32.0% | ||
| #2457 | Medium | 75% | 38.8% | |||
| #659 | Split Array into Consecutive Subsequences ArrayHash TableGreedyHeap (Priority Queue) | Medium | 65% | 52.4% | ||
| #1564 | Put Boxes Into the Warehouse I ArrayGreedySorting | Medium | 63% | 67.7% | ||
| #1899 | Merge Triplets to Form Target Triplet ArrayGreedy | Medium | 62% | 69.2% | ||
| #2208 | Minimum Operations to Halve Array Sum ArrayGreedyHeap (Priority Queue) | Medium | 60% | 0.5% | ||
| #2333 | Minimum Sum of Squared Difference ArrayBinary SearchGreedySortingHeap (Priority Queue) | Medium | 50% | 26.9% | ||
| #2375 | Construct Smallest Number From DI String StringBacktrackingStackGreedy | Medium | 44% | 85.5% | ||
| #3074 | Apple Redistribution into Boxes ArrayGreedySorting | Easy | 38% | 78.6% | ||
| #1578 | Minimum Time to Make Rope Colorful ArrayStringDynamic ProgrammingGreedy | Medium | 38% | 65.2% | ||
| #646 | Maximum Length of Pair Chain ArrayDynamic ProgrammingGreedySortingLongest Increasing Subsequence | Medium | 36% | 0.6% | ||
| #3229 | Minimum Operations to Make Array Equal to Target ArrayDynamic ProgrammingStackGreedyMonotonic Stack | Hard | 29% | 41.8% | ||
| #3075 | Maximize Happiness of Selected Children ArrayGreedySorting | Medium | 25% | 58.7% | ||
| #2566 | Maximum Difference by Remapping a Digit MathGreedy | Easy | 25% | 75.6% | ||
| #738 | Monotone Increasing Digits MathGreedy | Medium | 25% | 49.9% | ||
| #857 | Minimum Cost to Hire K Workers ArrayGreedySortingHeap (Priority Queue) | Hard | 25% | 63.7% | ||
| #942 | DI String Match ArrayTwo PointersStringGreedy | Easy | 25% | 81.2% | ||
| #955 | Delete Columns to Make Sorted II ArrayStringGreedy | Medium | 25% | 49.7% | ||
| #2311 | Longest Binary Subsequence Less Than or Equal to K StringDynamic ProgrammingGreedyMemoization | Medium | 25% | 52.8% | ||
| #2498 | Frog Jump II ArrayBinary SearchGreedy | Medium | 25% | 62.4% | ||
| #1541 | Minimum Insertions to Balance a Parentheses String StringStackGreedyBracket Sequences | Medium | 13% | 53.6% | ||
| #2864 | Maximum Odd Binary Number MathStringGreedy | Easy | 13% | 82.9% | ||
| #3296 | Minimum Number of Seconds to Make Mountain Height Zero ArrayMathBinary SearchGreedyHeap (Priority Queue) | Medium | 13% | 58.3% | ||
| #2037 | Minimum Number of Moves to Seat Everyone ArrayGreedySortingCounting Sort | Easy | 13% | 87.2% | ||
| #3600 | Maximize Spanning Tree Stability with Upgrades Binary SearchGreedyUnion-FindGraph TheoryMinimum Spanning Tree | Hard | 13% | 66.2% | ||
| #3691 | Maximum Total Subarray Value II ArrayGreedySegment TreeHeap (Priority Queue) | Hard | 13% | 41.7% | ||
| #1196 | How Many Apples Can You Put into the Basket ArrayGreedySorting | Easy | 100% | 0.7% | ||
| #3816 | Lexicographically Smallest String After Deleting Duplicate Characters Hash TableStringStackGreedyMonotonic Stack | Hard | 100% | 20.7% | ||
| #1567 | Maximum Length of Subarray With Positive Product ArrayDynamic ProgrammingGreedy | Medium | 100% | 44.7% | ||
| #2499 | Minimum Total Cost to Make Arrays Unequal ArrayHash TableGreedyCounting | Hard | 100% | 41.4% | ||
| #2285 | Maximum Total Importance of Roads GreedyGraph TheorySortingHeap (Priority Queue) | Medium | 100% | 0.7% | ||
| #3091 | Apply Operations to Make Sum of Array Greater Than or Equal to k MathGreedyEnumeration | Medium | 100% | 44.5% | ||
| #1675 | Minimize Deviation in Array ArrayGreedyHeap (Priority Queue)Ordered Set | Hard | 100% | 54.0% | ||
| #2263 | Make Array Non-decreasing or Non-increasing ArrayDynamic ProgrammingGreedyHeap (Priority Queue) | Hard | 100% | 65.5% | ||
| #2931 | Maximum Spending After Buying Items ArrayGreedySortingHeap (Priority Queue)Matrix | Hard | 100% | 61.4% | ||
| #1403 | Minimum Subsequence in Non-Increasing Order ArrayGreedySorting | Easy | 100% | 74.0% | ||
| #1864 | Medium | 100% | 44.0% | |||
| #2745 | Construct the Longest New String MathDynamic ProgrammingGreedyBrainteaser | Medium | 100% | 55.0% | ||
| #3119 | Maximum Number of Potholes That Can Be Fixed StringGreedySorting | Medium | 100% | 53.4% | ||
| #3796 | Find Maximum Value in a Constrained Sequence ArrayGreedy | Medium | 90% | 62.5% | ||
| #3049 | Earliest Second to Mark Indices II ArrayBinary SearchGreedyHeap (Priority Queue) | Hard | 88% | 22.7% | ||
| #3588 | Find Maximum Area of a Triangle ArrayHash TableMathGreedyGeometryEnumeration | Medium | 88% | 29.7% | ||
| #1754 | Largest Merge Of Two Strings Two PointersStringGreedy | Medium | 88% | 0.5% | ||
| #2449 | Minimum Number of Operations to Make Arrays Similar ArrayGreedySorting | Hard | 88% | 61.4% | ||
| #2659 | Make Array Empty ArrayBinary SearchGreedyBinary Indexed TreeSegment TreeSortingOrdered Set | Hard | 88% | 27.2% | ||
| #2554 | Maximum Number of Integers to Choose From a Range I ArrayHash TableBinary SearchGreedySorting | Medium | 76% | 68.0% | ||
| #1969 | Minimum Non-Zero Product of the Array Elements MathGreedyRecursion | Medium | 75% | 37.5% | ||
| #1589 | Maximum Sum Obtained of Any Permutation ArrayGreedySortingPrefix Sum | Medium | 75% | 41.2% | ||
| #2233 | Maximum Product After K Increments ArrayGreedyHeap (Priority Queue) | Medium | 75% | 44.1% | ||
| #2244 | Minimum Rounds to Complete All Tasks ArrayHash TableGreedyCounting | Medium | 63% | 63.4% | ||
| #1605 | Find Valid Matrix Given Row and Column Sums ArrayGreedyMatrixFlow Network | Medium | 63% | 82.6% | ||
| #1296 | Divide Array in Sets of K Consecutive Numbers ArrayHash TableGreedySorting | Medium | 63% | 59.5% | ||
| #1580 | Put Boxes Into the Warehouse II ArrayGreedySorting | Medium | 63% | 66.3% | ||
| #2241 | Design an ATM Machine ArrayGreedyDesign | Medium | 63% | 45.4% | ||
| #2611 | Mice and Cheese ArrayGreedySortingHeap (Priority Queue) | Medium | 51% | 48.9% | ||
| #3281 | Maximize Score of Numbers in Ranges ArrayBinary SearchGreedySorting | Medium | 50% | 35.9% | ||
| #3627 | Maximum Median Sum of Subsequences of Size 3 ArrayMathGreedySortingGame Theory | Medium | 50% | 65.1% | ||
| #2357 | Make Array Zero by Subtracting Equal Amounts ArrayHash TableGreedySortingHeap (Priority Queue)Simulation | Easy | 50% | 73.9% | ||
| #3413 | Maximum Coins From K Consecutive Bags ArrayBinary SearchGreedySliding WindowSortingPrefix Sum | Medium | 47% | 25.7% | ||
| #2279 | Maximum Bags With Full Capacity of Rocks ArrayGreedySorting | Medium | 47% | 68.2% | ||
| #1053 | Previous Permutation With One Swap ArrayGreedy | Medium | 38% | 49.2% | ||
| #2663 | Lexicographically Smallest Beautiful String StringGreedy | Hard | 38% | 38.5% | ||
| #3462 | Maximum Sum With at Most K Elements ArrayGreedySortingHeap (Priority Queue)Matrix | Medium | 29% | 60.9% | ||
| #2170 | Minimum Operations to Make the Array Alternating ArrayHash TableGreedyCounting | Medium | 29% | 35.8% | ||
| #517 | Super Washing Machines ArrayGreedy | Hard | 28% | 44.9% | ||
| #2294 | Partition Array Such That Maximum Difference Is K ArrayGreedySorting | Medium | 28% | 81.8% | ||
| #3002 | Maximum Size of a Set After Removals ArrayHash TableGreedy | Medium | 27% | 46.7% | ||
| #1509 | Minimum Difference Between Largest and Smallest Value in Three Moves ArrayGreedySorting | Medium | 27% | 59.2% | ||
| #3645 | Maximum Total from Optimal Activation Order ArrayTwo PointersGreedySortingHeap (Priority Queue) | Medium | 27% | 33.5% | ||
| #1673 | Find the Most Competitive Subsequence ArrayStackGreedyMonotonic Stack | Medium | 25% | 53.2% | ||
| #3545 | Minimum Deletions for At Most K Distinct Characters Hash TableStringGreedySortingCounting | Easy | 25% | 73.2% | ||
| #1054 | Distant Barcodes ArrayHash TableGreedySortingHeap (Priority Queue)Counting | Medium | 25% | 49.2% | ||
| #1850 | Minimum Adjacent Swaps to Reach the Kth Smallest Number Two PointersStringGreedy | Medium | 25% | 71.9% | ||
| #2870 | Minimum Number of Operations to Make Array Empty ArrayHash TableGreedyCounting | Medium | 25% | 62.2% | ||
| #2578 | Split With Minimum Sum MathGreedySorting | Easy | 25% | 73.8% | ||
| #2486 | Append Characters to String to Make Subsequence Two PointersStringGreedy | Medium | 25% | 73.1% | ||
| #2195 | Append K Integers With Minimal Sum ArrayMathGreedySorting | Medium | 25% | 27.1% | ||
| #1713 | Minimum Operations to Make a Subsequence ArrayHash TableBinary SearchGreedyLongest Increasing Subsequence | Hard | 25% | 49.9% | ||
| #774 | Minimize Max Distance to Gas Station ArrayBinary Search | Hard | 25% | 54.0% | ||
| #2350 | Shortest Impossible Sequence of Rolls ArrayHash TableGreedy | Hard | 25% | 69.3% | ||
| #2126 | Destroying Asteroids ArrayGreedySorting | Medium | 25% | 0.6% | ||
| #3720 | Lexicographically Smallest Permutation Greater Than Target Hash TableStringGreedyCountingEnumeration | Medium | 18% | 26.9% | ||
| #1536 | Minimum Swaps to Arrange a Binary Grid ArrayGreedyMatrix | Medium | 18% | 70.1% | ||
| #3635 | Earliest Finish Time for Land and Water Rides II ArrayTwo PointersBinary SearchGreedySorting | Medium | 16% | 64.3% | ||
| #1340 | Jump Game V ArrayDynamic ProgrammingSorting | Hard | 13% | 75.8% | ||
| #2818 | Apply Operations to Maximize Score ArrayMathStackGreedySortingMonotonic StackNumber Theory | Hard | 13% | 53.6% | ||
| #3282 | Reach End of Array With Max Score ArrayGreedy | Medium | 13% | 33.9% | ||
| #3732 | Maximum Product of Three Elements After One Replacement ArrayMathGreedySorting | Medium | 13% | 47.8% | ||
| #2600 | K Items With the Maximum Sum MathGreedy | Easy | 13% | 60.3% | ||
| #1561 | Maximum Number of Coins You Can Get ArrayMathGreedySortingGame Theory | Medium | 13% | 84.8% | ||
| #2706 | Buy Two Chocolates ArrayGreedySorting | Easy | 13% | 68.4% | ||
| #3326 | Minimum Division Operations to Make Array Non Decreasing ArrayMathGreedyNumber Theory | Medium | 13% | 29.4% | ||
| #2789 | Medium | 13% | 48.1% | |||
| #3260 | Find the Largest Palindrome Divisible by K MathStringDynamic ProgrammingGreedyNumber Theory | Hard | 13% | 17.2% | ||
| #3205 | Maximum Array Hopping Score I ArrayDynamic ProgrammingStackGreedyMonotonic Stack | Medium | 100% | 77.1% | ||
| #3221 | Maximum Array Hopping Score II ArrayStackGreedyMonotonic Stack | Medium | 100% | 59.8% | ||
| #1253 | Reconstruct a 2-Row Binary Matrix ArrayGreedyMatrix | Medium | 100% | 49.1% | ||
| #3207 | Maximum Points After Enemy Battles ArrayGreedy | Medium | 100% | 33.5% | ||
| #1702 | Maximum Binary String After Change StringGreedy | Medium | 100% | 47.8% | ||
| #3711 | Maximum Transactions Without Negative Balance ArrayGreedyHeap (Priority Queue) | Medium | 100% | 46.1% | ||
| #3496 | Maximize Score After Pair Deletions ArrayGreedy | Medium | 100% | 52.3% | ||
| #2900 | Longest Unequal Adjacent Groups Subsequence I ArrayStringDynamic ProgrammingGreedy | Easy | 100% | 66.9% | ||
| #2202 | Maximize the Topmost Element After K Moves ArrayGreedy | Medium | 100% | 24.1% | ||
| #1775 | Equal Sum Arrays With Minimum Number of Operations ArrayHash TableGreedyCounting | Medium | 100% | 54.7% | ||
| #1744 | Medium | 100% | 36.3% | |||
| #1338 | Reduce Array Size to The Half ArrayHash TableGreedySortingHeap (Priority Queue) | Medium | 100% | 69.4% | ||
| #555 | Split Concatenated Strings ArrayStringGreedy | Medium | 100% | 43.6% | ||
| #2971 | Find Polygon With the Largest Perimeter ArrayGreedySortingPrefix SumPolygons | Medium | 100% | 65.6% | ||
| #3106 | Medium | 100% | 62.9% | |||
| #2030 | Smallest K-Length Subsequence With Occurrences of a Letter StringStackGreedyMonotonic Stack | Hard | 100% | 40.0% | ||
| #625 | Minimum Factorization MathGreedyPrime Factorization | Medium | 100% | 34.1% | ||
| #1183 | Maximum Number of Ones MathGreedySortingHeap (Priority Queue) | Hard | 100% | 70.7% | ||
| #2897 | Apply Operations on Array to Maximize Sum of Squares ArrayHash TableGreedyBit Manipulation | Hard | 90% | 44.9% | ||
| #3022 | Minimize OR of Remaining Elements Using Operations ArrayGreedyBit Manipulation | Hard | 89% | 30.8% | ||
| #2029 | Stone Game IX ArrayMathGreedyMinimaxCountingGame TheoryNim GameZero-Sum Game | Medium | 88% | 30.5% | ||
| #2892 | Minimizing Array After Replacing Pairs With Their Product ArrayDynamic ProgrammingGreedy | Medium | 88% | 40.8% | ||
| #2541 | Minimum Operations to Make Array Equal II ArrayMathGreedy | Medium | 88% | 33.3% | ||
| #3628 | Maximum Number of Subsequences After One Inserting StringDynamic ProgrammingGreedyPrefix Sum | Medium | 83% | 32.1% | ||
| #2171 | Removing Minimum Number of Magic Beans ArrayGreedySortingEnumerationPrefix Sum | Medium | 75% | 44.8% | ||
| #1927 | Sum Game MathStringGreedyGame Theory | Medium | 75% | 49.5% | ||
| #1058 | Minimize Rounding Error to Meet Target ArrayMathStringGreedySorting | Medium | 75% | 45.9% | ||
| #2234 | Maximum Total Beauty of the Gardens ArrayTwo PointersBinary SearchGreedySortingEnumerationPrefix Sum | Hard | 75% | 30.2% | ||
| #3088 | Make String Anti-palindrome StringGreedySortingCounting Sort | Hard | 75% | 46.4% | ||
| #2557 | Maximum Number of Integers to Choose From a Range II ArrayBinary SearchGreedySorting | Medium | 75% | 35.0% | ||
| #3107 | Minimum Operations to Make Median of Array Equal to K ArrayGreedySorting | Medium | 75% | 48.1% | ||
| #2957 | Remove Adjacent Almost-Equal Characters StringDynamic ProgrammingGreedy | Medium | 75% | 53.8% | ||
| #3457 | Eat Pizzas! ArrayGreedySorting | Medium | 75% | 33.6% | ||
| #1946 | Largest Number After Mutating Substring ArrayStringGreedy | Medium | 75% | 38.3% | ||
| #2829 | Medium | 75% | 61.0% | |||
| #1798 | Maximum Number of Consecutive Values You Can Make ArrayGreedySorting | Medium | 75% | 64.3% | ||
| #2834 | Medium | 75% | 34.9% | |||
| #2856 | Minimum Array Length After Pair Removals ArrayHash TableTwo PointersBinary SearchGreedyCounting | Medium | 75% | 27.8% | ||
| #2136 | Earliest Possible Day of Full Bloom ArrayGreedySorting | Hard | 75% | 71.2% | ||
| #3402 | Minimum Operations to Make Columns Strictly Increasing ArrayGreedyMatrix | Easy | 70% | 72.8% | ||
| #3971 | Maximum Total Value ArrayMathBinary SearchGreedy | Hard | 65% | 30.3% | ||
| #936 | Stamping The Sequence StringStackGreedyQueue | Hard | 63% | 62.4% | ||
| #3511 | Make a Positive Array ArrayGreedyPrefix Sum | Medium | 63% | 36.4% | ||
| #2132 | Stamping the Grid ArrayGreedyMatrixPrefix Sum | Hard | 63% | 35.6% | ||
| #1505 | Minimum Possible Integer After at Most K Adjacent Swaps On Digits StringGreedyBinary Indexed TreeSegment Tree | Hard | 63% | 41.6% | ||
| #3086 | Minimum Moves to Pick K Ones ArrayGreedySliding WindowPrefix Sum | Hard | 63% | 21.8% | ||
| #3125 | Maximum Number That Makes Result of Bitwise AND Zero StringGreedySorting | Medium | 63% | 70.0% | ||
| #2712 | Minimum Cost to Make All Characters Equal StringDynamic ProgrammingGreedy | Medium | 60% | 54.5% | ||
| #3891 | Minimum Increase to Maximize Special Indices ArrayDynamic ProgrammingGreedyPrefix Sum | Medium | 50% | 19.8% | ||
| #2214 | Minimum Health to Beat Game ArrayGreedy | Medium | 50% | 58.9% | ||
| #1705 | Maximum Number of Eaten Apples ArrayGreedyHeap (Priority Queue) | Medium | 50% | 43.7% | ||
| #1968 | Array With Elements Not Equal to Average of Neighbors ArrayGreedySorting | Medium | 50% | 50.9% | ||
| #3192 | Minimum Operations to Make Binary Array Elements Equal to One II ArrayDynamic ProgrammingGreedy | Medium | 50% | 65.3% | ||
| #2673 | Make Costs of Paths Equal in a Binary Tree ArrayDynamic ProgrammingGreedyTreeBinary Tree | Medium | 39% | 58.8% | ||
| #3914 | Medium | 39% | 55.5% | |||
| #3139 | Minimum Cost to Equalize Array ArrayGreedyEnumeration | Hard | 38% | 19.0% | ||
| #3752 | Lexicographically Smallest Negated Permutation that Sums to Target ArrayMathTwo PointersGreedySorting | Medium | 38% | 31.4% | ||
| #2790 | Maximum Number of Groups With Increasing Length ArrayMathBinary SearchGreedySorting | Hard | 38% | 23.3% | ||
| #3785 | Minimum Swaps to Avoid Forbidden Values ArrayHash TableGreedyCounting | Hard | 29% | 30.9% | ||
| #2216 | Minimum Deletions to Make Array Beautiful ArrayStackGreedy | Medium | 27% | 50.2% | ||
| #2599 | Make the Prefix Sum Non-negative ArrayGreedyHeap (Priority Queue) | Medium | 27% | 51.9% | ||
| #2548 | Maximum Price to Fill a Bag ArrayGreedySorting | Medium | 27% | 64.7% | ||
| #2847 | Smallest Number With Given Digit Product MathGreedy | Medium | 27% | 43.6% | ||
| #3111 | Minimum Rectangles to Cover Points ArrayGreedySorting | Medium | 27% | 64.0% | ||
| #3680 | Generate Schedule ArrayMathGreedy | Medium | 25% | 24.9% | ||
| #3572 | Maximize Y‑Sum by Picking a Triplet of Distinct X‑Values ArrayHash TableGreedySortingHeap (Priority Queue) | Medium | 25% | 63.5% | ||
| #3806 | Maximum Bitwise AND After Increment Operations ArrayGreedyBit ManipulationSorting | Hard | 25% | 32.2% | ||
| #2207 | Maximize Number of Subsequences in a String StringGreedyPrefix Sum | Medium | 25% | 36.2% | ||
| #2340 | Minimum Adjacent Swaps to Make a Valid Array ArrayGreedy | Medium | 25% | 72.3% | ||
| #3605 | Minimum Stability Factor of Array ArrayMathBinary SearchGreedySegment TreeNumber Theory | Hard | 25% | 20.8% | ||
| #3927 | Minimize Array Sum Using Divisible Replacements ArrayHash TableMathGreedyNumber Theory | Medium | 25% | 32.2% | ||
| #1520 | Maximum Number of Non-Overlapping Substrings Hash TableStringGreedySorting | Hard | 25% | 43.2% | ||
| #1764 | Form Array by Concatenating Subarrays of Another Array ArrayTwo PointersGreedyString MatchingKnuth–Morris–Pratt Algorithm | Medium | 25% | 55.0% | ||
| #2268 | Minimum Number of Keypresses Hash TableStringGreedySortingCounting | Medium | 25% | 71.5% | ||
| #2323 | Find Minimum Time to Finish All Jobs II ArrayGreedySorting | Medium | 25% | 66.1% | ||
| #3081 | Replace Question Marks in String to Minimize Its Value Hash TableStringGreedySortingHeap (Priority Queue)Counting | Medium | 25% | 29.4% | ||
| #2910 | Minimum Number of Groups to Create a Valid Assignment ArrayHash TableGreedy | Medium | 25% | 25.4% | ||
| #1363 | Largest Multiple of Three ArrayMathDynamic ProgrammingGreedySorting | Hard | 25% | 33.4% | ||
| #1558 | Minimum Numbers of Function Calls to Make Target Array ArrayGreedyBit Manipulation | Medium | 25% | 62.8% | ||
| #1788 | Maximize the Beauty of the Garden ArrayHash TableGreedyPrefix Sum | Hard | 25% | 65.0% | ||
| #2297 | Jump Game VIII ArrayDynamic ProgrammingStackGraph TheoryMonotonic StackShortest Path | Medium | 25% | 45.9% | ||
| #2412 | Minimum Money Required Before Transactions ArrayGreedySorting | Hard | 25% | 42.2% | ||
| #3730 | Maximum Calories Burnt from Jumps ArrayTwo PointersGreedySorting | Medium | 25% | 72.0% | ||
| #3767 | Maximize Points After Choosing K Tasks ArrayGreedySortingHeap (Priority Queue) | Medium | 25% | 60.3% | ||
| #3781 | Maximum Score After Binary Swaps ArrayStringGreedyHeap (Priority Queue) | Medium | 25% | 35.4% | ||
| #3952 | Maximum Total Value of Covered Indices ArrayStringDynamic ProgrammingGreedy | Medium | 25% | 28.2% | ||
| #1736 | Latest Time by Replacing Hidden Digits StringGreedy | Easy | 25% | 43.9% | ||
| #1996 | The Number of Weak Characters in the Game ArrayStackGreedySortingMonotonic Stack | Medium | 25% | 44.6% | ||
| #1388 | Pizza With 3n Slices ArrayDynamic ProgrammingGreedyHeap (Priority Queue) | Hard | 25% | 54.1% | ||
| #2178 | Maximum Split of Positive Even Integers MathBacktrackingGreedy | Medium | 25% | 59.8% | ||
| #2842 | Count K-Subsequences of a String With Maximum Beauty Hash TableMathStringGreedySortingCombinatoricsFermat's Little Theorem | Hard | 25% | 30.5% | ||
| #1147 | Longest Chunked Palindrome Decomposition Two PointersStringDynamic ProgrammingGreedyRolling HashHash Function | Hard | 25% | 59.0% | ||
| #1414 | Medium | 25% | 65.0% | |||
| #484 | Find Permutation ArrayStringStackGreedy | Medium | 25% | 66.8% | ||
| #954 | Array of Doubled Pairs ArrayHash TableGreedySorting | Medium | 25% | 39.9% | ||
| #1199 | Minimum Time to Build Blocks ArrayMathGreedyHeap (Priority Queue) | Hard | 25% | 46.6% | ||
| #1090 | Largest Values From Labels ArrayHash TableGreedySortingCounting | Medium | 25% | 64.5% | ||
| #1144 | Decrease Elements To Make Array Zigzag ArrayGreedy | Medium | 25% | 49.3% | ||
| #1546 | Maximum Number of Non-Overlapping Subarrays With Sum Equals Target ArrayHash TableGreedyPrefix Sum | Medium | 25% | 49.1% | ||
| #1585 | Check If String Is Transformable With Substring Sort Operations StringGreedySorting | Hard | 25% | 51.7% | ||
| #1708 | Largest Subarray Length K ArrayGreedy | Easy | 25% | 65.9% | ||
| #1753 | Maximum Score From Removing Stones MathGreedyHeap (Priority Queue) | Medium | 25% | 68.7% | ||
| #1794 | Count Pairs of Equal Substrings With Minimum Difference Hash TableStringGreedy | Medium | 25% | 64.0% | ||
| #1874 | Minimize Product Sum of Two Arrays ArrayGreedySorting | Medium | 25% | 89.9% | ||
| #2224 | Minimum Number of Operations to Convert Time StringGreedy | Easy | 25% | 66.6% | ||
| #2967 | Minimum Cost to Make Array Equalindromic ArrayMathBinary SearchGreedySorting | Medium | 25% | 23.6% | ||
| #3695 | Maximize Alternating Sum Using Swaps ArrayGreedyUnion-FindSorting | Hard | 18% | 64.8% | ||
| #3858 | Minimum Bitwise OR From Grid ArrayGreedyBit ManipulationMatrix | Medium | 18% | 27.4% | ||
| #3638 | Maximum Balanced Shipments ArrayDynamic ProgrammingStackGreedyMonotonic Stack | Medium | 16% | 61.5% | ||
| #3458 | Select K Disjoint Special Substrings Hash TableStringDynamic ProgrammingGreedySorting | Medium | 13% | 19.4% | ||
| #3273 | Minimum Amount of Damage Dealt to Bob ArrayGreedySorting | Hard | 13% | 40.0% | ||
| #3357 | Minimize the Maximum Adjacent Element Difference ArrayBinary SearchGreedy | Hard | 13% | 19.9% | ||
| #1881 | Maximum Value after Insertion StringGreedy | Medium | 13% | 39.6% | ||
| #3780 | Maximum Sum of Three Numbers Divisible by Three ArrayGreedySortingHeap (Priority Queue) | Medium | 13% | 47.6% | ||
| #2383 | Easy | 13% | 42.7% | |||
| #376 | Wiggle Subsequence ArrayDynamic ProgrammingGreedy | Medium | 13% | 49.6% | ||
| #3557 | Find Maximum Number of Non Intersecting Substrings Hash TableStringDynamic ProgrammingGreedy | Medium | 13% | 31.1% | ||
| #3547 | Maximum Sum of Edge Values in a Graph MathGreedyGraph Theory | Hard | 13% | 37.0% | ||
| #3776 | Minimum Moves to Balance Circular Array ArrayGreedySorting | Medium | 13% | 40.5% | ||
| #3946 | Maximum Number of Items From Sale I ArrayDynamic ProgrammingGreedy | Medium | 13% | 37.3% | ||
| #2573 | Find the String with LCP ArrayStringDynamic ProgrammingGreedyUnion-FindMatrix | Hard | 13% | 63.1% | ||
| #3523 | Make Array Non-decreasing ArrayStackGreedyMonotonic Stack | Medium | 13% | 57.5% | ||
| #3630 | Partition Array for Maximum XOR and AND ArrayMathGreedyBit ManipulationEnumeration | Hard | 13% | 17.9% | ||
| #2589 | Minimum Time to Complete All Tasks ArrayBinary SearchStackGreedySorting | Hard | 13% | 40.1% | ||
| #2335 | Minimum Amount of Time to Fill Cups ArrayGreedySortingHeap (Priority Queue) | Easy | 13% | 60.5% | ||
| #3723 | Maximize Sum of Squares of Digits MathGreedy | Medium | 13% | 59.1% | ||
| #3219 | Minimum Cost for Cutting Cake II ArrayGreedySorting | Hard | 13% | 55.4% |
Showing 410 of 410 problems in Greedy AlgorithmsFiltered: All Companies