Candy Distribution
Compute the minimum total candies needed so that every child gets at least one and children with higher ratings than neighbors get more candies.
Remove K Digits to Form the Smallest Number
Given a non-negative integer as a string, remove exactly k digits to form the smallest possible integer without leading zeros.
Maximize units on truck
Given box types with count and units per box, maximize total units loaded onto a truck.
Bag of Tokens Score
Given tokens with values and initial power, determine the maximum score achievable by selling tokens for power or buying tokens for score.
Job Sequencing with Deadlines and Profits
Given jobs with deadlines and profits, choose a subset that maximizes profit while meeting deadline constraints.
Max events attended
Given a list of events with start and end times, find the maximum number of non-overlapping events you can attend.
Showing 6 challenges · Greedy Algorithms
Greedy Algorithms — Python coding challenges
What you will find here
This page lists greedy algorithms challenges — real Python problems you solve in the browser IDE with instant test feedback. Each challenge includes a clear brief, starter code, and automated checks.
Challenges vs tutorials and quizzes
Challenges test what you can build under constraints. For guided teaching, use our Python tutorials. For quick checks, try quizzes or copy snippets from code samples.