Course Schedule III
Solve this the way you would in the interview: out loud, on a timer, with an AI interviewer asking follow-ups while you code. You get a scored report at the end.
Practice this as a mock interviewFree to start, no account neededProblem
There are n online courses. courses[i] = [duration_i, lastDay_i] means course i takes duration_i consecutive days and must be **finished no later than** day lastDay_i.
You start on day 1 and can take only one course at a time, back to back. A course taking d days started right after finishing at day t finishes at day t + d. Each course can be taken at most once, and you may skip any course.
Return the **maximum number** of courses you can complete.
Examples
Constraints
- `1 <= courses.length <= 10^4`
- `1 <= duration_i, lastDay_i <= 10^4`
What the interviewer grades
A correct solution is one of five scores. The report also grades problem understanding (did you clarify inputs and edge cases before coding), problem solving, communication while you work, code quality, and testing. See a sample report, or read up on the pattern in the lessons.