PhantomCodeAI
Features
Mock Interview
Dashboard
Jobs
Pricing
Resources
Help
Features
Mock Interview
Dashboard
Jobs
Pricing
Resources
Help
PhantomCodeAI
Features
Mock Interview
Dashboard
Jobs
Pricing
Resources
Help
Features
Mock Interview
Dashboard
Jobs
Pricing
Resources
Help
Home
LeetCode Problems
Greedy
Greedy
Problems
377 Greedy LeetCode problems · Solve with AI-powered hints & step-by-step explanations.
11
Container With Most Water
Medium
44
Wildcard Matching
Hard
45
Jump Game II
Medium
55
Jump Game
Medium
122
Best Time to Buy and Sell Stock II
Medium
134
Gas Station
Medium
135
Candy
Hard
179
Largest Number
Medium
316
Remove Duplicate Letters
Medium
321
Create Maximum Number
Hard
324
Wiggle Sort II
Medium
330
Patching Array
Hard
334
Increasing Triplet Subsequence
Medium
376
Wiggle Subsequence
Medium
397
Integer Replacement
Medium
402
Remove K Digits
Medium
409
Longest Palindrome
Easy
410
Split Array Largest Sum
Hard
420
Strong Password Checker
Hard
435
Non-overlapping Intervals
Medium
452
Minimum Number of Arrows to Burst Balloons
Medium
455
Assign Cookies
Easy
502
IPO
Hard
517
Super Washing Machines
Hard
561
Array Partition
Easy
581
Shortest Unsorted Continuous Subarray
Medium
605
Can Place Flowers
Easy
611
Valid Triangle Number
Medium
621
Task Scheduler
Medium
624
Maximum Distance in Arrays
Medium
630
Course Schedule III
Hard
632
Smallest Range Covering Elements from K Lists
Hard
646
Maximum Length of Pair Chain
Medium
649
Dota2 Senate
Medium
659
Split Array into Consecutive Subsequences
Medium
670
Maximum Swap
Medium
678
Valid Parenthesis String
Medium
680
Valid Palindrome II
Easy
714
Best Time to Buy and Sell Stock with Transaction Fee
Medium
738
Monotone Increasing Digits
Medium
757
Set Intersection Size At Least Two
Hard
763
Partition Labels
Medium
765
Couples Holding Hands
Hard
767
Reorganize String
Medium
768
Max Chunks To Make Sorted II
Hard
769
Max Chunks To Make Sorted
Medium
781
Rabbits in Forest
Medium
807
Max Increase to Keep City Skyline
Medium
826
Most Profit Assigning Work
Medium
846
Hand of Straights
Medium
857
Minimum Cost to Hire K Workers
Hard
860
Lemonade Change
Easy
861
Score After Flipping Matrix
Medium
870
Advantage Shuffle
Medium
871
Minimum Number of Refueling Stops
Hard
881
Boats to Save People
Medium
910
Smallest Range II
Medium
921
Minimum Add to Make Parentheses Valid
Medium
936
Stamping The Sequence
Hard
942
DI String Match
Easy
945
Minimum Increment to Make Array Unique
Medium
948
Bag of Tokens
Medium
954
Array of Doubled Pairs
Medium
955
Delete Columns to Make Sorted II
Medium
969
Pancake Sorting
Medium
976
Largest Perimeter Triangle
Easy
984
String Without AAA or BBB
Medium
991
Broken Calculator
Medium
1005
Maximize Sum Of Array After K Negations
Easy
1007
Minimum Domino Rotations For Equal Row
Medium
1013
Partition Array Into Three Parts With Equal Sum
Easy
1024
Video Stitching
Medium
1029
Two City Scheduling
Medium
1053
Previous Permutation With One Swap
Medium
1054
Distant Barcodes
Medium
1081
Smallest Subsequence of Distinct Characters
Medium
1090
Largest Values From Labels
Medium
1130
Minimum Cost Tree From Leaf Values
Medium
1144
Decrease Elements To Make Array Zigzag
Medium
1147
Longest Chunked Palindrome Decomposition
Hard
1217
Minimum Cost to Move Chips to The Same Position
Easy
1221
Split a String in Balanced Strings
Easy
1247
Minimum Swaps to Make Strings Equal
Medium
1253
Reconstruct a 2-Row Binary Matrix
Medium
1262
Greatest Sum Divisible by Three
Medium
1282
Group the People Given the Group Size They Belong To
Medium
1296
Divide Array in Sets of K Consecutive Numbers
Medium
1323
Maximum 69 Number
Easy
1326
Minimum Number of Taps to Open to Water a Garden
Hard
1328
Break a Palindrome
Medium
1330
Reverse Subarray To Maximize Array Value
Hard
1338
Reduce Array Size to The Half
Medium
1353
Maximum Number of Events That Can Be Attended
Medium
1363
Largest Multiple of Three
Hard
1382
Balance a Binary Search Tree
Medium
1383
Maximum Performance of a Team
Hard
1386
Cinema Seat Allocation
Medium
1388
Pizza With 3n Slices
Hard
1400
Construct K Palindrome Strings
Medium
1402
Reducing Dishes
Hard
1403
Minimum Subsequence in Non-Increasing Order
Easy
1405
Longest Happy String
Medium
1414
Find the Minimum Number of Fibonacci Numbers Whose Sum Is K
Medium
1432
Max Difference You Can Get From Changing an Integer
Medium
1433
Check If a String Can Break Another String
Medium
1465
Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts
Medium
1481
Least Number of Unique Integers after K Removals
Medium
1488
Avoid Flood in The City
Medium
1505
Minimum Possible Integer After at Most K Adjacent Swaps On Digits
Hard
1509
Minimum Difference Between Largest and Smallest Value in Three Moves
Medium
1520
Maximum Number of Non-Overlapping Substrings
Hard
1526
Minimum Number of Increments on Subarrays to Form a Target Array
Hard
1529
Minimum Suffix Flips
Medium
1536
Minimum Swaps to Arrange a Binary Grid
Medium
1537
Get the Maximum Score
Hard
1541
Minimum Insertions to Balance a Parentheses String
Medium
1546
Maximum Number of Non-Overlapping Subarrays With Sum Equals Target
Medium
1558
Minimum Numbers of Function Calls to Make Target Array
Medium
1561
Maximum Number of Coins You Can Get
Medium
1567
Maximum Length of Subarray With Positive Product
Medium
1578
Minimum Time to Make Rope Colorful
Medium
1585
Check If String Is Transformable With Substring Sort Operations
Hard
1589
Maximum Sum Obtained of Any Permutation
Medium
1605
Find Valid Matrix Given Row and Column Sums
Medium
1606
Find Servers That Handled Most Number of Requests
Hard
1642
Furthest Building You Can Reach
Medium
1647
Minimum Deletions to Make Character Frequencies Unique
Medium
1648
Sell Diminishing-Valued Colored Balls
Medium
1663
Smallest String With A Given Numeric Value
Medium
1665
Minimum Initial Energy to Finish Tasks
Hard
1671
Minimum Number of Removals to Make Mountain Array
Hard
1673
Find the Most Competitive Subsequence
Medium
1675
Minimize Deviation in Array
Hard
1686
Stone Game VI
Medium
1689
Partitioning Into Minimum Number Of Deci-Binary Numbers
Medium
1702
Maximum Binary String After Change
Medium
1703
Minimum Adjacent Swaps for K Consecutive Ones
Hard
1705
Maximum Number of Eaten Apples
Medium
1710
Maximum Units on a Truck
Easy
1713
Minimum Operations to Make a Subsequence
Hard
1717
Maximum Score From Removing Substrings
Medium
1727
Largest Submatrix With Rearrangements
Medium
1733
Minimum Number of People to Teach
Medium
1736
Latest Time by Replacing Hidden Digits
Easy
1739
Building Boxes
Hard
1753
Maximum Score From Removing Stones
Medium
1754
Largest Merge Of Two Strings
Medium
1764
Form Array by Concatenating Subarrays of Another Array
Medium
1775
Equal Sum Arrays With Minimum Number of Operations
Medium
1785
Minimum Elements to Add to Form a Given Sum
Medium
1792
Maximum Average Pass Ratio
Medium
1798
Maximum Number of Consecutive Values You Can Make
Medium
1802
Maximum Value at a Given Index in a Bounded Array
Medium
1824
Minimum Sideway Jumps
Medium
1827
Minimum Operations to Make the Array Increasing
Easy
1833
Maximum Ice Cream Bars
Medium
1838
Frequency of the Most Frequent Element
Medium
1846
Maximum Element After Decreasing and Rearranging
Medium
1850
Minimum Adjacent Swaps to Reach the Kth Smallest Number
Medium
1864
Minimum Number of Swaps to Make the Binary String Alternating
Medium
1877
Minimize Maximum Pair Sum in Array
Medium
1881
Maximum Value after Insertion
Medium
1899
Merge Triplets to Form Target Triplet
Medium
1903
Largest Odd Number in String
Easy
1921
Eliminate Maximum Number of Monsters
Medium
1927
Sum Game
Medium
1936
Add Minimum Number of Rungs
Medium
1946
Largest Number After Mutating Substring
Medium
1953
Maximum Number of Weeks for Which You Can Work
Medium
1962
Remove Stones to Minimize the Total
Medium
1963
Minimum Number of Swaps to Make the String Balanced
Medium
1968
Array With Elements Not Equal to Average of Neighbors
Medium
1969
Minimum Non-Zero Product of the Array Elements
Medium
1974
Minimum Time to Type Word Using Special Typewriter
Easy
1975
Maximum Matrix Sum
Medium
1996
The Number of Weak Characters in the Game
Medium
2007
Find Original Array From Doubled Array
Medium
2014
Longest Subsequence Repeated k Times
Hard
2027
Minimum Moves to Convert String
Easy
2029
Stone Game IX
Medium
2030
Smallest K-Length Subsequence With Occurrences of a Letter
Hard
2037
Minimum Number of Moves to Seat Everyone
Easy
2038
Remove Colored Pieces if Both Neighbors are the Same Color
Medium
2064
Minimized Maximum of Products Distributed to Any Store
Medium
2071
Maximum Number of Tasks You Can Assign
Hard
2078
Two Furthest Houses With Different Colors
Easy
2086
Minimum Number of Food Buckets to Feed the Hamsters
Medium
2087
Minimum Cost Homecoming of a Robot in a Grid
Medium
2091
Removing Minimum and Maximum From Array
Medium
2116
Check if a Parentheses String Can Be Valid
Medium
2126
Destroying Asteroids
Medium
2131
Longest Palindrome by Concatenating Two Letter Words
Medium
2132
Stamping the Grid
Hard
2136
Earliest Possible Day of Full Bloom
Hard
2139
Minimum Moves to Reach Target Score
Medium
2141
Maximum Running Time of N Computers
Hard
2144
Minimum Cost of Buying Candies With Discount
Easy
2160
Minimum Sum of Four Digit Number After Splitting Digits
Easy
2170
Minimum Operations to Make the Array Alternating
Medium
2171
Removing Minimum Number of Magic Beans
Medium
2178
Maximum Split of Positive Even Integers
Medium
2182
Construct String With Repeat Limit
Medium
2193
Minimum Number of Moves to Make Palindrome
Hard
2195
Append K Integers With Minimal Sum
Medium
2202
Maximize the Topmost Element After K Moves
Medium
2207
Maximize Number of Subsequences in a String
Medium
2208
Minimum Operations to Halve Array Sum
Medium
2216
Minimum Deletions to Make Array Beautiful
Medium
2224
Minimum Number of Operations to Convert Time
Easy
2233
Maximum Product After K Increments
Medium
2234
Maximum Total Beauty of the Gardens
Hard
2241
Design an ATM Machine
Medium
2244
Minimum Rounds to Complete All Tasks
Medium
2259
Remove Digit From Number to Maximize Result
Easy
2271
Maximum White Tiles Covered by a Carpet
Medium
2279
Maximum Bags With Full Capacity of Rocks
Medium
2285
Maximum Total Importance of Roads
Medium
2294
Partition Array Such That Maximum Difference Is K
Medium
2310
Sum of Numbers With Units Digit K
Medium
2311
Longest Binary Subsequence Less Than or Equal to K
Medium
2333
Minimum Sum of Squared Difference
Medium
2335
Minimum Amount of Time to Fill Cups
Easy
2350
Shortest Impossible Sequence of Rolls
Hard
2357
Make Array Zero by Subtracting Equal Amounts
Easy
2358
Maximum Number of Groups Entering a Competition
Medium
2366
Minimum Replacements to Sort the Array
Hard
2375
Construct Smallest Number From DI String
Medium
2383
Minimum Hours of Training to Win a Competition
Easy
2384
Largest Palindromic Number
Medium
2389
Longest Subsequence With Limited Sum
Easy
2405
Optimal Partition of String
Medium
2406
Divide Intervals Into Minimum Number of Groups
Medium
2410
Maximum Matching of Players With Trainers
Medium
2412
Minimum Money Required Before Transactions
Hard
2429
Minimize XOR
Medium
2434
Using a Robot to Print the Lexicographically Smallest String
Medium
2439
Minimize Maximum of Array
Medium
2448
Minimum Cost to Make Array Equal
Hard
2449
Minimum Number of Operations to Make Arrays Similar
Hard
2457
Minimum Addition to Make Integer Beautiful
Medium
2472
Maximum Number of Non-overlapping Palindrome Substrings
Hard
2486
Append Characters to String to Make Subsequence
Medium
2497
Maximum Star Sum of a Graph
Medium
2498
Frog Jump II
Medium
2499
Minimum Total Cost to Make Arrays Unequal
Hard
2517
Maximum Tastiness of Candy Basket
Medium
2522
Partition String Into Substrings With Values at Most K
Medium
2528
Maximize the Minimum Powered City
Hard
2530
Maximal Score After Applying K Operations
Medium
2541
Minimum Operations to Make Array Equal II
Medium
2542
Maximum Subsequence Score
Medium
2551
Put Marbles in Bags
Hard
2554
Maximum Number of Integers to Choose From a Range I
Medium
2560
House Robber IV
Medium
2561
Rearranging Fruits
Hard
2566
Maximum Difference by Remapping a Digit
Easy
2567
Minimum Score by Changing Two Elements
Medium
2571
Minimum Operations to Reduce an Integer to 0
Medium
2573
Find the String with LCP
Hard
2576
Find the Maximum Number of Marked Indices
Medium
2578
Split With Minimum Sum
Easy
2587
Rearrange Array to Maximize Prefix Score
Medium
2589
Minimum Time to Complete All Tasks
Hard
2591
Distribute Money to Maximum Children
Easy
2592
Maximize Greatness of an Array
Medium
2598
Smallest Missing Non-negative Integer After Operations
Medium
2600
K Items With the Maximum Sum
Easy
2601
Prime Subtraction Operation
Medium
2607
Make K-Subarray Sums Equal
Medium
2611
Mice and Cheese
Medium
2616
Minimize the Maximum Difference of Pairs
Medium
2645
Minimum Additions to Make Valid String
Medium
2656
Maximum Sum With Exactly K Elements
Easy
2659
Make Array Empty
Hard
2663
Lexicographically Smallest Beautiful String
Hard
2673
Make Costs of Paths Equal in a Binary Tree
Medium
2680
Maximum OR
Medium
2697
Lexicographically Smallest Palindrome
Easy
2706
Buy Two Chocolates
Easy
2708
Maximum Strength of a Group
Medium
2712
Minimum Cost to Make All Characters Equal
Medium
2734
Lexicographically Smallest String After Substring Operation
Medium
2745
Construct the Longest New String
Medium
2789
Largest Element in an Array after Merge Operations
Medium
2790
Maximum Number of Groups With Increasing Length
Hard
2800
Shortest String That Contains Three Strings
Medium
2811
Check if it is Possible to Split Array
Medium
2813
Maximum Elegance of a K-Length Subsequence
Hard
2818
Apply Operations to Maximize Score
Hard
2829
Determine the Minimum Sum of a k-avoiding Array
Medium
2834
Find the Minimum Possible Sum of a Beautiful Array
Medium
2835
Minimum Operations to Form Subsequence With Target Sum
Hard
2842
Count K-Subsequences of a String With Maximum Beauty
Hard
2844
Minimum Operations to Make a Special Number
Medium
2856
Minimum Array Length After Pair Removals
Medium
2864
Maximum Odd Binary Number
Easy
2870
Minimum Number of Operations to Make Array Empty
Medium
2871
Split Array Into Maximum Number of Subarrays
Medium
2895
Minimum Processing Time
Medium
2897
Apply Operations on Array to Maximize Sum of Squares
Hard
2900
Longest Unequal Adjacent Groups Subsequence I
Easy
2910
Minimum Number of Groups to Create a Valid Assignment
Medium
2918
Minimum Equal Sum of Two Arrays After Replacing Zeros
Medium
2931
Maximum Spending After Buying Items
Hard
2938
Separate Black and White Balls
Medium
2939
Maximum Xor Product
Medium
2952
Minimum Number of Coins to be Added
Medium
2957
Remove Adjacent Almost-Equal Characters
Medium
2966
Divide Array Into Arrays With Max Difference
Medium
2967
Minimum Cost to Make Array Equalindromic
Medium
2971
Find Polygon With the Largest Perimeter
Medium
3002
Maximum Size of a Set After Removals
Medium
3012
Minimize Length of Array Using Operations
Medium
3014
Minimum Number of Pushes to Type Word I
Easy
3016
Minimum Number of Pushes to Type Word II
Medium
3022
Minimize OR of Remaining Elements Using Operations
Hard
3035
Maximum Palindromes After Operations
Medium
3049
Earliest Second to Mark Indices II
Hard
3068
Find the Maximum Sum of Node Values
Hard
3074
Apple Redistribution into Boxes
Easy
3075
Maximize Happiness of Selected Children
Medium
3081
Replace Question Marks in String to Minimize Its Value
Medium
3085
Minimum Deletions to Make String K-Special
Medium
3086
Minimum Moves to Pick K Ones
Hard
3091
Apply Operations to Make Sum of Array Greater Than or Equal to k
Medium
3106
Lexicographically Smallest String After Operations With Constraint
Medium
3107
Minimum Operations to Make Median of Array Equal to K
Medium
3111
Minimum Rectangles to Cover Points
Medium
3139
Minimum Cost to Equalize Array
Hard
3170
Lexicographically Minimum String After Removing Stars
Medium
3192
Minimum Operations to Make Binary Array Elements Equal to One II
Medium
3207
Maximum Points After Enemy Battles
Medium
3216
Lexicographically Smallest String After a Swap
Easy
3218
Minimum Cost for Cutting Cake I
Medium
3219
Minimum Cost for Cutting Cake II
Hard
3228
Maximum Number of Operations to Move Ones to the End
Medium
3229
Minimum Operations to Make Array Equal to Target
Hard
3244
Shortest Distance After Road Addition Queries II
Hard
3260
Find the Largest Palindrome Divisible by K
Hard
3273
Minimum Amount of Damage Dealt to Bob
Hard
3281
Maximize Score of Numbers in Ranges
Medium
3282
Reach End of Array With Max Score
Medium
3296
Minimum Number of Seconds to Make Mountain Height Zero
Medium
3301
Maximize the Total Height of Unique Towers
Medium
3302
Find the Lexicographically Smallest Valid Sequence
Medium
3326
Minimum Division Operations to Make Array Non Decreasing
Medium
3348
Smallest Divisible Digit Product II
Hard
3357
Minimize the Maximum Adjacent Element Difference
Hard
3362
Zero Array Transformation III
Medium
3397
Maximum Number of Distinct Elements After Operations
Medium
3402
Minimum Operations to Make Columns Strictly Increasing
Easy
3413
Maximum Coins From K Consecutive Bags
Medium
3424
Minimum Cost to Make Arrays Identical
Medium
3434
Maximum Frequency After Subarray Operation
Medium
3439
Reschedule Meetings for Maximum Free Time I
Medium
3440
Reschedule Meetings for Maximum Free Time II
Medium
3449
Maximize the Minimum Game Score
Hard
3457
Eat Pizzas!
Medium
3458
Select K Disjoint Special Substrings
Medium
3462
Maximum Sum With at Most K Elements
Medium
3464
Maximize the Distance Between Points on a Square
Hard
3474
Lexicographically Smallest Generated String
Hard
3487
Maximum Unique Subarray Sum After Deletion
Easy
3523
Make Array Non-decreasing
Medium
3534
Path Existence Queries in a Graph II
Hard
3542
Minimum Operations to Convert All Elements to Zero
Medium
3545
Minimum Deletions for At Most K Distinct Characters
Easy
3547
Maximum Sum of Edge Values in a Graph
Hard
3557
Find Maximum Number of Non Intersecting Substrings
Medium
3572
Maximize Y‑Sum by Picking a Triplet of Distinct X‑Values
Medium
3576
Transform Array to All Equal Elements
Medium
3579
Minimum Steps to Convert String with Operations
Hard
3587
Minimum Adjacent Swaps to Alternate Parity
Medium
3588
Find Maximum Area of a Triangle
Medium
3600
Maximize Spanning Tree Stability with Upgrades
Hard
3605
Minimum Stability Factor of Array
Hard
3630
Partition Array for Maximum XOR and AND
Hard
← Browse all LeetCode problems