Practice Problems
Reinforce your greedy skills with curated problems. Mix of easy, medium, and hard challenges covering all the patterns you have learned.
35 lessons
153 min
Codeforces: 800-2000LeetCode: 1300-1900
Lessons
1. Intro
Practice makes permanent
2m
2. How to Practice Greedy
Building intuition
3m
3. Problem - Maximize Sum of Array After K Negations
Flip negatives
2m1 problems
4. K Negations - Greedy Approach
Flip smallest first
2m
5. K Negations - Implementation
The code
2m1 problems
6. Quiz: K Negations
Handling odd flips
1m1 problems
7. Problem - Minimum Cost to Connect Sticks
Huffman-like merging
2m1 problems
8. Connect Sticks - Greedy Insight
Always merge smallest
2m
9. Connect Sticks - Implementation
The code
2m1 problems
10. Problem - Two City Scheduling
Split evenly
2m1 problems
11. Two City - Greedy Insight
Sort by savings
2m
12. Two City - Implementation
The code
2m1 problems
13. Problem - Bag of Tokens
Play optimally
2m1 problems
14. Bag of Tokens - Two Pointer Greedy
Small face-up, large face-down
2m
15. Bag of Tokens - Implementation
The code
2m1 problems
16. Quiz: Bag of Tokens
Why track max score
1m1 problems
17. Problem - Broken Calculator
Work backwards
2m1 problems
18. Broken Calculator - Reverse Greedy
Halve or add
2m
19. Broken Calculator - Implementation
The code
2m1 problems
20. Problem - Minimum Deletions to Make Character Frequencies Unique
No duplicate frequencies
2m1 problems
21. Minimum Deletions - Greedy Approach
Reduce duplicates
2m
22. Minimum Deletions - Implementation
The code
2m1 problems
23. Problem - Valid Parenthesis String
With wildcards
2m1 problems
24. Valid Parenthesis - Greedy Range
Track min and max
2m
25. Valid Parenthesis - Implementation
The code
2m1 problems
26. Problem - Wiggle Subsequence
Alternating differences
2m1 problems
27. Wiggle Subsequence - Greedy Insight
Count direction changes
2m
28. Wiggle Subsequence - Implementation
The code
2m1 problems
29. Quiz: Wiggle Subsequence
Why this greedy works
1m1 problems
30. Summary: Greedy Problem Categories
Pattern recognition
3m
31. Easy Problems
Build confidence
15m3 problems
32. Medium Problems
Core practice
30m4 problems
33. Hard Problems
Challenge yourself
45m3 problems
34. What is Next
Continue learning
2m
35. Section Recap
What we learned
2m
Practice Problems
1.
The Clockcodeforces
2.
X-Sumcodeforces
3.
Carouselcodeforces
4.
Sequence and Swapscodeforces
5.
Palindromifiercodeforces
6.
Permutation Shift (Hard)codeforces
7.
Preparing for Merge Sortcodeforces
8.
Interacdive Problemcodeforces
9.
Number of Groupscodeforces
10.
Balanced Binary Search Treescodeforces