Stock Buy Sell Once
Given daily stock prices, compute the maximum profit you can achieve from buying once and selling once later.
Assign Cookies
Given child greed factors and cookie sizes, return the maximum number of content children.
Partition Labels
Partition a string into maximal parts where each character appears in only one part, returning part lengths.
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.
Maximum Ice Cream Bars
Given costs of ice cream bars and coins, return the maximum number you can buy.
Painter Partition Problem
Given board lengths and k painters, find the minimum possible maximum total length a painter must paint.
IPO Maximize Capital
Given project profits and capital requirements, choose at most k projects to maximize final capital.
Job Sequencing with Deadlines and Profits
Given jobs with deadlines and profits, choose a subset that maximizes profit while meeting deadline constraints.
Jump Game Reachable
Given an array of non-negative integers where each element is the maximum jump length, determine if you can reach the last index.
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 1–11 of 11 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.