Tap here to switch tabs
Problem
Submissions

Problem: Course Schedule III

In Course Schedule III, each course has a duration and deadline. Starting on day one and taking courses one at a time, return the maximum number finished on time.

Statement

You are given an array courses where courses[i] = [duration_i, lastDay_i] indicates that the iextthi^{ ext{th}} course requires duration_i continuous days to complete and must be finished on or before day lastDay_i.

You begin on day 11 and can only take one course at a time.

Return the maximum number of courses you can finish.

Constraints:

  • 1≤1 \leq courses.length ≤104\leq 10^4

  • 1≤1 \leq duration_i, lastDay_i ≤104\leq 10^4

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Course Schedule III

In Course Schedule III, each course has a duration and deadline. Starting on day one and taking courses one at a time, return the maximum number finished on time.

Statement

You are given an array courses where courses[i] = [duration_i, lastDay_i] indicates that the iextthi^{ ext{th}} course requires duration_i continuous days to complete and must be finished on or before day lastDay_i.

You begin on day 11 and can only take one course at a time.

Return the maximum number of courses you can finish.

Constraints:

  • 1≤1 \leq courses.length ≤104\leq 10^4

  • 1≤1 \leq duration_i, lastDay_i ≤104\leq 10^4