Editor

Greedy algorithm problems in Python

Take the best step now and check that it is enough: greedy problems in Python, with tests that check your solution.

Beginner

  1. 27. Coins at the TillHand back change using as few coins as possible30 XP6 min
  2. 51. Change at the Ticket BoothCan the booth give every customer the right change?45 XP10 min

Intermediate

  1. 58. Cookies for ChildrenMake as many children happy as the cookie jar allows60 XP10 min
  2. 69. Jump to the EndIs the last stepping stone within reach?65 XP10 min
  3. 93. Most Meetings in One RoomSqueeze as many bookings as possible into one meeting room75 XP14 min
  4. 302. Fewest Arrows to Pop the BalloonsBalloons cover a long wall. How few shots will pop every one of them?70 XP14 min
  5. 306. One Truck per TownCut a line of parcels into as many truckloads as the towns allow70 XP14 min

Advanced

  1. 128. Fewest Jumps to the EndReach the last square in as few hops as possible120 XP20 min
  2. 134. Fuel Stops on a Ring RoadWhere should a road trip start so the tank never runs dry?125 XP22 min
  3. 142. Largest Number from PiecesLine the numbers up to spell the biggest number possible130 XP22 min
  4. 163. Tasks with a CooldownHow long does the machine need when repeats must wait?150 XP30 min
  5. 386. Gold Stars in a RowMore stars than your neighbour if you scored higher, using as few as possible140 XP25 min
  6. 399. Rebuild the Photo LineEveryone remembers how many taller players stood ahead. Rebuild the line145 XP30 min
  7. 431. No Twin NeighboursRearrange the letters so that no letter sits next to its twin175 XP35 min

Expert

  1. 438. Fewest Stops Across the DesertA rally car, a desert and a trail of fuel depots: how few stops will do?210 XP35 min
  2. 450. Stamps for Every PostageHow few new stamps let you pay every postage exactly?220 XP35 min
  3. 457. Most Courses Before Their DeadlinesSo many online courses, so little time: how many can you really finish?230 XP40 min
  4. 486. Hire the Cheapest CrewEveryone paid by skill, nobody below their asking price: what does a crew cost?260 XP50 min

Other topics

Or see every challenge, with study plans, today's challenge and duels.