Skip to content

Commit 97130b5

Browse files
Update job_scheduling.py
1 parent 6b73c38 commit 97130b5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

dynamic_programming/job_scheduling.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ def job_scheduling(jobs):
1616
>>> job_scheduling(jobs)
1717
250
1818
"""
19+
if not jobs:
20+
return 0
1921
# Sort jobs by end time
2022
jobs = sorted(jobs, key=lambda x: x[1])
2123
n = len(jobs)

0 commit comments

Comments
 (0)