CoursesDynamic Programming

Scheduling DP

Lessons
9
Exercises
56
Minutes
62
  1. 1

    Decisions Over Time

    Scheduling DP walks a timeline: at each moment either TAKE the current opportunity and jump past whatever it blocks, or SKIP to the next moment — with phases and sorting to keep the past well-defined.

    Complete codeMultiple choice
    6 exercises
    5 min
  2. 2

    Stock with Cooldown

    A state-machine DP: each day is hold, sold, or rest, and the transitions — especially 'buys come only from rest' — enforce the cooldown that greedy trading skips.

    Complete codeDebugMultiple choiceTrace
    6 exercises
    7 min
  3. 3

    Minimum Cost For Tickets

    DP over the CALENDAR, not the travel list: non-travel days copy dp[d-1] for free, travel days take the cheapest of a 1-, 7-, or 30-day pass reaching back along real dates.

    Complete codeMultiple choiceTrace
    6 exercises
    7 min
  4. 4

    Solving Questions With Brainpower

    Backward DP: taking question i earns its points but jumps you past the questions it blocks, so dp[i] = max(skip, take) must be filled from the end — with a clamp on the jump and a long for the totals.

    Complete codeMultiple choiceTrace
    6 exercises
    7 min
  5. 5

    Maximum Earnings From Taxi

    Weighted interval scheduling on a number line: bucket rides by END point, then dp over positions — drive past empty (dp[p-1]) or finish a ride there (dp[start] + distance + tip). The direct primer for the job-scheduling boss.

    Complete codeMultiple choiceTrace
    6 exercises
    7 min
  6. 6

    Maximum Length of Pair Chain

    Two correct answers, one clear winner: LIS-style DP after sorting by first element works in O(n^2) — but when every interval counts equally, greedy by END point solves it in O(n log n). Learn when scheduling DP collapses to greedy.

    Multiple choiceTrace
    6 exercises
    6 min
  7. 7

    Scheduling DP CheckpointCheckpoint

    No new concepts — the island's take-or-skip-over-time move on unseen ground: gig shifts with rest gaps, a meeting room selling its hours, stock trading with a flat fee, and certification sprints that burn you out.

    Complete codeCode orderMultiple choiceTrace
    6 exercises
    7 min
  8. 8

    Scheduling DP ReviewReview

    Mixed recap of the island: the one take-and-jump-or-skip skeleton behind every mini, when 'what am I holding' joins the state, calendar dp versus event dp, backward fills when takes jump forward, the sort-by-end discipline, and the exact line where greedy stops working.

    Complete codeMultiple choice
    6 exercises
    6 min
  9. 9

    Boss: Maximum Profit in Job SchedulingBoss

    The island's final test: weighted jobs on one timeline. Sort by end, binary-search each job's predecessor, and let one take/skip recurrence price every schedule — while the boss tempts you with count-greedy, start-sorting, and the strict-inequality boundary.

    Complete codeDebugCode orderMultiple choiceTrace
    8 exercises
    10 min
AlgoFox Pro

Dynamic Programming is part of AlgoFox Pro

You can read the whole course outline here. The exercises are in the app, along with your streak, your mistake review, and the progress that carries across your devices.

Pro starts with a 3 day free trial. The app store decides who is eligible for an introductory offer, and a lapsed subscription does not get another one.

Download AlgoFox on the App StoreGet AlgoFox on Google Play

Already subscribed in the app? Sign in with the same account and Pro works here too. Quick Play and Battle are free on the web, and so is the first course in every subject.