Skip to content

Greedy Problems

Practice Greedy coding problems with detailed solutions and an in-browser JavaScript runner. Each problem includes examples, constraints, and a working code editor.

14 problems

Title Difficulty
Best Time to Buy and Sell Stock II Medium
Gas Station Medium
Integer to Roman Medium
Jump Game Medium
Minimum Cost to Hire K Workers Hard
Minimum Cost Tree From Leaf Values Medium
Minimum Number of Refueling Stops Hard
Pair Arrays to Meet a Minimum Sum Easy
Minimum Spanning Tree with Prim’s Algorithm Medium
Zigzag Linked List Medium
Split Array Largest Sum Hard
Aggressive Cows Hard
Text Justification Hard
The Celebrity Problem Hard