# Greedy DSA Problems

> 407 Greedy coding problems for placements and interviews, sorted easiest first, with hints and company tags. Free practice on InternHack.

Canonical: https://www.internhack.in/learn/dsa/greedy
Last updated: 2026-11-28

407 greedy problems for coding interviews and campus placements, with hints and company tags. Below are the first 100 of 407: 46 easy, 0 medium and 54 hard. Practise them free on InternHack and track what you have solved.

## Greedy problems, easiest first

1. [Apple Redistribution into Boxes](https://www.internhack.in/learn/dsa/problem/apple-redistribution-into-boxes) (Easy)
2. [Array Partition](https://www.internhack.in/learn/dsa/problem/array-partition) (Easy)
3. [Assign Cookies](https://www.internhack.in/learn/dsa/problem/assign-cookies) (Easy)
4. [Buy Two Chocolates](https://www.internhack.in/learn/dsa/problem/buy-two-chocolates) (Easy)
5. [Can Place Flowers](https://www.internhack.in/learn/dsa/problem/can-place-flowers) (Easy)
6. [DI String Match](https://www.internhack.in/learn/dsa/problem/di-string-match) (Easy)
7. [Distribute Money to Maximum Children](https://www.internhack.in/learn/dsa/problem/distribute-money-to-maximum-children) (Easy)
8. [How Many Apples Can You Put into the Basket](https://www.internhack.in/learn/dsa/problem/how-many-apples-can-you-put-into-the-basket) (Easy)
9. [Largest Odd Number in String](https://www.internhack.in/learn/dsa/problem/largest-odd-number-in-string) (Easy)
10. [Largest Perimeter Triangle](https://www.internhack.in/learn/dsa/problem/largest-perimeter-triangle) (Easy)
11. [Largest Subarray Length K](https://www.internhack.in/learn/dsa/problem/largest-subarray-length-k) (Easy)
12. [Latest Time by Replacing Hidden Digits](https://www.internhack.in/learn/dsa/problem/latest-time-by-replacing-hidden-digits) (Easy)
13. [Lemonade Change](https://www.internhack.in/learn/dsa/problem/lemonade-change) (Easy)
14. [Lexicographically Smallest Palindrome](https://www.internhack.in/learn/dsa/problem/lexicographically-smallest-palindrome) (Easy)
15. [Lexicographically Smallest String After a Swap](https://www.internhack.in/learn/dsa/problem/lexicographically-smallest-string-after-a-swap) (Easy)
16. [Longest Palindrome](https://www.internhack.in/learn/dsa/problem/longest-palindrome) (Easy)
17. [Longest Subsequence With Limited Sum](https://www.internhack.in/learn/dsa/problem/longest-subsequence-with-limited-sum) (Easy)
18. [Longest Unequal Adjacent Groups Subsequence I](https://www.internhack.in/learn/dsa/problem/longest-unequal-adjacent-groups-subsequence-i) (Easy)
19. [Make Array Zero by Subtracting Equal Amounts](https://www.internhack.in/learn/dsa/problem/make-array-zero-by-subtracting-equal-amounts) (Easy)
20. [Maximize Sum Of Array After K Negations](https://www.internhack.in/learn/dsa/problem/maximize-sum-of-array-after-k-negations) (Easy)
21. [Maximum 69 Number](https://www.internhack.in/learn/dsa/problem/maximum-69-number) (Easy)
22. [Maximum Difference by Remapping a Digit](https://www.internhack.in/learn/dsa/problem/maximum-difference-by-remapping-a-digit) (Easy)
23. [Maximum Odd Binary Number](https://www.internhack.in/learn/dsa/problem/maximum-odd-binary-number) (Easy)
24. [Maximum Sum With Exactly K Elements](https://www.internhack.in/learn/dsa/problem/maximum-sum-with-exactly-k-elements) (Easy)
25. [Maximum Unique Subarray Sum After Deletion](https://www.internhack.in/learn/dsa/problem/maximum-unique-subarray-sum-after-deletion) (Easy)
26. [Maximum Units on a Truck](https://www.internhack.in/learn/dsa/problem/maximum-units-on-a-truck) (Easy)
27. [Minimum Amount of Time to Fill Cups](https://www.internhack.in/learn/dsa/problem/minimum-amount-of-time-to-fill-cups) (Easy)
28. [Minimum Cost of Buying Candies With Discount](https://www.internhack.in/learn/dsa/problem/minimum-cost-of-buying-candies-with-discount) (Easy)
29. [Minimum Cost to Move Chips to The Same Position](https://www.internhack.in/learn/dsa/problem/minimum-cost-to-move-chips-to-the-same-position) (Easy)
30. [Minimum Deletions for At Most K Distinct Characters](https://www.internhack.in/learn/dsa/problem/minimum-deletions-for-at-most-k-distinct-characters) (Easy)
31. [Minimum Hours of Training to Win a Competition](https://www.internhack.in/learn/dsa/problem/minimum-hours-of-training-to-win-a-competition) (Easy)
32. [Minimum Moves to Convert String](https://www.internhack.in/learn/dsa/problem/minimum-moves-to-convert-string) (Easy)
33. [Minimum Number of Moves to Seat Everyone](https://www.internhack.in/learn/dsa/problem/minimum-number-of-moves-to-seat-everyone) (Easy)
34. [Minimum Number of Operations to Convert Time](https://www.internhack.in/learn/dsa/problem/minimum-number-of-operations-to-convert-time) (Easy)
35. [Minimum Number of Pushes to Type Word I](https://www.internhack.in/learn/dsa/problem/minimum-number-of-pushes-to-type-word-i) (Easy)
36. [Minimum Operations to Make Columns Strictly Increasing](https://www.internhack.in/learn/dsa/problem/minimum-operations-to-make-columns-strictly-increasing) (Easy)
37. [Minimum Operations to Make the Array Increasing](https://www.internhack.in/learn/dsa/problem/minimum-operations-to-make-the-array-increasing) (Easy)
38. [Minimum Subsequence in Non-Increasing Order](https://www.internhack.in/learn/dsa/problem/minimum-subsequence-in-non-increasing-order) (Easy)
39. [Minimum Sum of Four Digit Number After Splitting Digits](https://www.internhack.in/learn/dsa/problem/minimum-sum-of-four-digit-number-after-splitting-digits) (Easy)
40. [Minimum Time to Type Word Using Special Typewriter](https://www.internhack.in/learn/dsa/problem/minimum-time-to-type-word-using-special-typewriter) (Easy)
41. [Partition Array Into Three Parts With Equal Sum](https://www.internhack.in/learn/dsa/problem/partition-array-into-three-parts-with-equal-sum) (Easy)
42. [Remove Digit From Number to Maximize Result](https://www.internhack.in/learn/dsa/problem/remove-digit-from-number-to-maximize-result) (Easy)
43. [Split a String in Balanced Strings](https://www.internhack.in/learn/dsa/problem/split-a-string-in-balanced-strings) (Easy)
44. [Split With Minimum Sum](https://www.internhack.in/learn/dsa/problem/split-with-minimum-sum) (Easy)
45. [Two Furthest Houses With Different Colors](https://www.internhack.in/learn/dsa/problem/two-furthest-houses-with-different-colors) (Easy)
46. [Valid Palindrome II](https://www.internhack.in/learn/dsa/problem/valid-palindrome-ii) (Easy)
47. [Apply Operations on Array to Maximize Sum of Squares](https://www.internhack.in/learn/dsa/problem/apply-operations-on-array-to-maximize-sum-of-squares) (Hard)
48. [Apply Operations to Maximize Score](https://www.internhack.in/learn/dsa/problem/apply-operations-to-maximize-score) (Hard)
49. [Candy](https://www.internhack.in/learn/dsa/problem/candy) (Hard)
50. [Check If String Is Transformable With Substring Sort Operations](https://www.internhack.in/learn/dsa/problem/check-if-string-is-transformable-with-substring-sort-operations) (Hard)
51. [Count K-Subsequences of a String With Maximum Beauty](https://www.internhack.in/learn/dsa/problem/count-k-subsequences-of-a-string-with-maximum-beauty) (Hard)
52. [Couples Holding Hands](https://www.internhack.in/learn/dsa/problem/couples-holding-hands) (Hard)
53. [Course Schedule III](https://www.internhack.in/learn/dsa/problem/course-schedule-iii) (Hard)
54. [Create Maximum Number](https://www.internhack.in/learn/dsa/problem/create-maximum-number) (Hard)
55. [Earliest Possible Day of Full Bloom](https://www.internhack.in/learn/dsa/problem/earliest-possible-day-of-full-bloom) (Hard)
56. [Earliest Second to Mark Indices II](https://www.internhack.in/learn/dsa/problem/earliest-second-to-mark-indices-ii) (Hard)
57. [Find the Largest Palindrome Divisible by K](https://www.internhack.in/learn/dsa/problem/find-the-largest-palindrome-divisible-by-k) (Hard)
58. [Find the Maximum Sum of Node Values](https://www.internhack.in/learn/dsa/problem/find-the-maximum-sum-of-node-values) (Hard)
59. [Find the String with LCP](https://www.internhack.in/learn/dsa/problem/find-the-string-with-lcp) (Hard)
60. [Get the Maximum Score](https://www.internhack.in/learn/dsa/problem/get-the-maximum-score) (Hard)
61. [IPO](https://www.internhack.in/learn/dsa/problem/ipo) (Hard)
62. [Largest Multiple of Three](https://www.internhack.in/learn/dsa/problem/largest-multiple-of-three) (Hard)
63. [Lexicographically Smallest Beautiful String](https://www.internhack.in/learn/dsa/problem/lexicographically-smallest-beautiful-string) (Hard)
64. [Lexicographically Smallest Generated String](https://www.internhack.in/learn/dsa/problem/lexicographically-smallest-generated-string) (Hard)
65. [Lexicographically Smallest String After Deleting Duplicate Characters](https://www.internhack.in/learn/dsa/problem/lexicographically-smallest-string-after-deleting-duplicate-characters) (Hard)
66. [Longest Chunked Palindrome Decomposition](https://www.internhack.in/learn/dsa/problem/longest-chunked-palindrome-decomposition) (Hard)
67. [Make Array Empty](https://www.internhack.in/learn/dsa/problem/make-array-empty) (Hard)
68. [Make Array Non-decreasing or Non-increasing](https://www.internhack.in/learn/dsa/problem/make-array-non-decreasing-or-non-increasing) (Hard)
69. [Make String Anti-palindrome](https://www.internhack.in/learn/dsa/problem/make-string-anti-palindrome) (Hard)
70. [Max Chunks To Make Sorted II](https://www.internhack.in/learn/dsa/problem/max-chunks-to-make-sorted-ii) (Hard)
71. [Maximize Alternating Sum Using Swaps](https://www.internhack.in/learn/dsa/problem/maximize-alternating-sum-using-swaps) (Hard)
72. [Maximize the Beauty of the Garden](https://www.internhack.in/learn/dsa/problem/maximize-the-beauty-of-the-garden) (Hard)
73. [Maximize the Minimum Game Score](https://www.internhack.in/learn/dsa/problem/maximize-the-minimum-game-score) (Hard)
74. [Maximize the Minimum Powered City](https://www.internhack.in/learn/dsa/problem/maximize-the-minimum-powered-city) (Hard)
75. [Maximum Bitwise AND After Increment Operations](https://www.internhack.in/learn/dsa/problem/maximum-bitwise-and-after-increment-operations) (Hard)
76. [Maximum Number of Groups With Increasing Length](https://www.internhack.in/learn/dsa/problem/maximum-number-of-groups-with-increasing-length) (Hard)
77. [Maximum Number of Non-overlapping Palindrome Substrings](https://www.internhack.in/learn/dsa/problem/maximum-number-of-non-overlapping-palindrome-substrings) (Hard)
78. [Maximum Number of Non-Overlapping Substrings](https://www.internhack.in/learn/dsa/problem/maximum-number-of-non-overlapping-substrings) (Hard)
79. [Maximum Number of Ones](https://www.internhack.in/learn/dsa/problem/maximum-number-of-ones) (Hard)
80. [Maximum Number of Tasks You Can Assign](https://www.internhack.in/learn/dsa/problem/maximum-number-of-tasks-you-can-assign) (Hard)
81. [Maximum Performance of a Team](https://www.internhack.in/learn/dsa/problem/maximum-performance-of-a-team) (Hard)
82. [Maximum Running Time of N Computers](https://www.internhack.in/learn/dsa/problem/maximum-running-time-of-n-computers) (Hard)
83. [Maximum Spending After Buying Items](https://www.internhack.in/learn/dsa/problem/maximum-spending-after-buying-items) (Hard)
84. [Maximum Sum of Edge Values in a Graph](https://www.internhack.in/learn/dsa/problem/maximum-sum-of-edge-values-in-a-graph) (Hard)
85. [Maximum Total Beauty of the Gardens](https://www.internhack.in/learn/dsa/problem/maximum-total-beauty-of-the-gardens) (Hard)
86. [Minimize Deviation in Array](https://www.internhack.in/learn/dsa/problem/minimize-deviation-in-array) (Hard)
87. [Minimize OR of Remaining Elements Using Operations](https://www.internhack.in/learn/dsa/problem/minimize-or-of-remaining-elements-using-operations) (Hard)
88. [Minimize the Maximum Adjacent Element Difference](https://www.internhack.in/learn/dsa/problem/minimize-the-maximum-adjacent-element-difference) (Hard)
89. [Minimum Adjacent Swaps for K Consecutive Ones](https://www.internhack.in/learn/dsa/problem/minimum-adjacent-swaps-for-k-consecutive-ones) (Hard)
90. [Minimum Amount of Damage Dealt to Bob](https://www.internhack.in/learn/dsa/problem/minimum-amount-of-damage-dealt-to-bob) (Hard)
91. [Minimum Cost to Equalize Array](https://www.internhack.in/learn/dsa/problem/minimum-cost-to-equalize-array) (Hard)
92. [Minimum Cost to Hire K Workers](https://www.internhack.in/learn/dsa/problem/minimum-cost-to-hire-k-workers) (Hard)
93. [Minimum Cost to Make Array Equal](https://www.internhack.in/learn/dsa/problem/minimum-cost-to-make-array-equal) (Hard)
94. [Minimum Initial Energy to Finish Tasks](https://www.internhack.in/learn/dsa/problem/minimum-initial-energy-to-finish-tasks) (Hard)
95. [Minimum Money Required Before Transactions](https://www.internhack.in/learn/dsa/problem/minimum-money-required-before-transactions) (Hard)
96. [Minimum Moves to Pick K Ones](https://www.internhack.in/learn/dsa/problem/minimum-moves-to-pick-k-ones) (Hard)
97. [Minimum Number of Increments on Subarrays to Form a Target Array](https://www.internhack.in/learn/dsa/problem/minimum-number-of-increments-on-subarrays-to-form-a-target-array) (Hard)
98. [Minimum Number of Moves to Make Palindrome](https://www.internhack.in/learn/dsa/problem/minimum-number-of-moves-to-make-palindrome) (Hard)
99. [Minimum Number of Operations to Make Arrays Similar](https://www.internhack.in/learn/dsa/problem/minimum-number-of-operations-to-make-arrays-similar) (Hard)
100. [Minimum Number of Refueling Stops](https://www.internhack.in/learn/dsa/problem/minimum-number-of-refueling-stops) (Hard)

## Companies that ask greedy problems

- [Google](https://www.internhack.in/learn/dsa/companies/google): 62 of these problems
- [Amazon](https://www.internhack.in/learn/dsa/companies/amazon): 56 of these problems
- [Meta](https://www.internhack.in/learn/dsa/companies/meta): 32 of these problems
- [Microsoft](https://www.internhack.in/learn/dsa/companies/microsoft): 28 of these problems
- [Bloomberg](https://www.internhack.in/learn/dsa/companies/bloomberg): 26 of these problems
- [Oracle](https://www.internhack.in/learn/dsa/companies/oracle): 9 of these problems
- [Tiktok](https://www.internhack.in/learn/dsa/companies/tiktok): 9 of these problems
- [Apple](https://www.internhack.in/learn/dsa/companies/apple): 8 of these problems
- [IBM](https://www.internhack.in/learn/dsa/companies/ibm): 7 of these problems
- [Salesforce](https://www.internhack.in/learn/dsa/companies/salesforce): 7 of these problems
- [Accenture](https://www.internhack.in/learn/dsa/companies/accenture): 4 of these problems
- [Uber](https://www.internhack.in/learn/dsa/companies/uber): 4 of these problems

## Before your interview

Most resumes are filtered by software before a recruiter reads them. [Check your resume ATS score free](https://www.internhack.in/ats-score/try), no signup needed.

## Other DSA topics

- [Array](https://www.internhack.in/learn/dsa/array) (1869)
- [String](https://www.internhack.in/learn/dsa/string) (775)
- [Hash Table](https://www.internhack.in/learn/dsa/hash-table) (708)
- [Math](https://www.internhack.in/learn/dsa/math) (564)
- [Dynamic Programming](https://www.internhack.in/learn/dsa/dynamic-programming) (557)
- [Sorting](https://www.internhack.in/learn/dsa/sorting) (464)
- [Depth-First Search](https://www.internhack.in/learn/dsa/depth-first-search) (314)
- [Binary Search](https://www.internhack.in/learn/dsa/binary-search) (298)
- [Matrix](https://www.internhack.in/learn/dsa/matrix) (246)
- [Breadth-First Search](https://www.internhack.in/learn/dsa/breadth-first-search) (245)
- [Bit Manipulation](https://www.internhack.in/learn/dsa/bit-manipulation) (238)
- [Tree](https://www.internhack.in/learn/dsa/tree) (235)
- [Two Pointers](https://www.internhack.in/learn/dsa/two-pointers) (217)
- [Prefix Sum](https://www.internhack.in/learn/dsa/prefix-sum) (204)
- [Database](https://www.internhack.in/learn/dsa/database) (197)
- [Heap (Priority Queue)](https://www.internhack.in/learn/dsa/heap-priority-queue) (196)
- [Simulation](https://www.internhack.in/learn/dsa/simulation) (177)
- [Counting](https://www.internhack.in/learn/dsa/counting) (174)
- [Binary Tree](https://www.internhack.in/learn/dsa/binary-tree) (169)
- [Stack](https://www.internhack.in/learn/dsa/stack) (167)

## Related

- [Home](https://www.internhack.in/)
- [Learn](https://www.internhack.in/learn)
- [DSA](https://www.internhack.in/learn/dsa)
