Greedy DSA Problems

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 (Easy)
  2. Array Partition (Easy)
  3. Assign Cookies (Easy)
  4. Buy Two Chocolates (Easy)
  5. Can Place Flowers (Easy)
  6. DI String Match (Easy)
  7. Distribute Money to Maximum Children (Easy)
  8. How Many Apples Can You Put into the Basket (Easy)
  9. Largest Odd Number in String (Easy)
  10. Largest Perimeter Triangle (Easy)
  11. Largest Subarray Length K (Easy)
  12. Latest Time by Replacing Hidden Digits (Easy)
  13. Lemonade Change (Easy)
  14. Lexicographically Smallest Palindrome (Easy)
  15. Lexicographically Smallest String After a Swap (Easy)
  16. Longest Palindrome (Easy)
  17. Longest Subsequence With Limited Sum (Easy)
  18. Longest Unequal Adjacent Groups Subsequence I (Easy)
  19. Make Array Zero by Subtracting Equal Amounts (Easy)
  20. Maximize Sum Of Array After K Negations (Easy)
  21. Maximum 69 Number (Easy)
  22. Maximum Difference by Remapping a Digit (Easy)
  23. Maximum Odd Binary Number (Easy)
  24. Maximum Sum With Exactly K Elements (Easy)
  25. Maximum Unique Subarray Sum After Deletion (Easy)
  26. Maximum Units on a Truck (Easy)
  27. Minimum Amount of Time to Fill Cups (Easy)
  28. Minimum Cost of Buying Candies With Discount (Easy)
  29. Minimum Cost to Move Chips to The Same Position (Easy)
  30. Minimum Deletions for At Most K Distinct Characters (Easy)
  31. Minimum Hours of Training to Win a Competition (Easy)
  32. Minimum Moves to Convert String (Easy)
  33. Minimum Number of Moves to Seat Everyone (Easy)
  34. Minimum Number of Operations to Convert Time (Easy)
  35. Minimum Number of Pushes to Type Word I (Easy)
  36. Minimum Operations to Make Columns Strictly Increasing (Easy)
  37. Minimum Operations to Make the Array Increasing (Easy)
  38. Minimum Subsequence in Non-Increasing Order (Easy)
  39. Minimum Sum of Four Digit Number After Splitting Digits (Easy)
  40. Minimum Time to Type Word Using Special Typewriter (Easy)
  41. Partition Array Into Three Parts With Equal Sum (Easy)
  42. Remove Digit From Number to Maximize Result (Easy)
  43. Split a String in Balanced Strings (Easy)
  44. Split With Minimum Sum (Easy)
  45. Two Furthest Houses With Different Colors (Easy)
  46. Valid Palindrome II (Easy)
  47. Apply Operations on Array to Maximize Sum of Squares (Hard)
  48. Apply Operations to Maximize Score (Hard)
  49. Candy (Hard)
  50. Check If String Is Transformable With Substring Sort Operations (Hard)
  51. Count K-Subsequences of a String With Maximum Beauty (Hard)
  52. Couples Holding Hands (Hard)
  53. Course Schedule III (Hard)
  54. Create Maximum Number (Hard)
  55. Earliest Possible Day of Full Bloom (Hard)
  56. Earliest Second to Mark Indices II (Hard)
  57. Find the Largest Palindrome Divisible by K (Hard)
  58. Find the Maximum Sum of Node Values (Hard)
  59. Find the String with LCP (Hard)
  60. Get the Maximum Score (Hard)
  61. IPO (Hard)
  62. Largest Multiple of Three (Hard)
  63. Lexicographically Smallest Beautiful String (Hard)
  64. Lexicographically Smallest Generated String (Hard)
  65. Lexicographically Smallest String After Deleting Duplicate Characters (Hard)
  66. Longest Chunked Palindrome Decomposition (Hard)
  67. Make Array Empty (Hard)
  68. Make Array Non-decreasing or Non-increasing (Hard)
  69. Make String Anti-palindrome (Hard)
  70. Max Chunks To Make Sorted II (Hard)
  71. Maximize Alternating Sum Using Swaps (Hard)
  72. Maximize the Beauty of the Garden (Hard)
  73. Maximize the Minimum Game Score (Hard)
  74. Maximize the Minimum Powered City (Hard)
  75. Maximum Bitwise AND After Increment Operations (Hard)
  76. Maximum Number of Groups With Increasing Length (Hard)
  77. Maximum Number of Non-overlapping Palindrome Substrings (Hard)
  78. Maximum Number of Non-Overlapping Substrings (Hard)
  79. Maximum Number of Ones (Hard)
  80. Maximum Number of Tasks You Can Assign (Hard)
  81. Maximum Performance of a Team (Hard)
  82. Maximum Running Time of N Computers (Hard)
  83. Maximum Spending After Buying Items (Hard)
  84. Maximum Sum of Edge Values in a Graph (Hard)
  85. Maximum Total Beauty of the Gardens (Hard)
  86. Minimize Deviation in Array (Hard)
  87. Minimize OR of Remaining Elements Using Operations (Hard)
  88. Minimize the Maximum Adjacent Element Difference (Hard)
  89. Minimum Adjacent Swaps for K Consecutive Ones (Hard)
  90. Minimum Amount of Damage Dealt to Bob (Hard)
  91. Minimum Cost to Equalize Array (Hard)
  92. Minimum Cost to Hire K Workers (Hard)
  93. Minimum Cost to Make Array Equal (Hard)
  94. Minimum Initial Energy to Finish Tasks (Hard)
  95. Minimum Money Required Before Transactions (Hard)
  96. Minimum Moves to Pick K Ones (Hard)
  97. Minimum Number of Increments on Subarrays to Form a Target Array (Hard)
  98. Minimum Number of Moves to Make Palindrome (Hard)
  99. Minimum Number of Operations to Make Arrays Similar (Hard)
  100. Minimum Number of Refueling Stops (Hard)

Companies that ask greedy problems

Before your interview

Most resumes are filtered by software before a recruiter reads them. Check your resume ATS score free, no signup needed.

Other DSA topics