We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2364494 commit 57fbc03Copy full SHA for 57fbc03
greedy_methods/activity_selection.py
@@ -37,7 +37,7 @@ def activity_selection(activities: list[tuple[int, int]]) -> list[tuple[int, int
37
"""
38
39
# Step 1: Sort the activities by their end time
40
- sorted_activities = sorted(activities, key=lambda x: x[1])
+ sorted_activities = sorted(activities, key=lambda activity: activity[1])
41
42
# Step 2: Select the first activity (the one that finishes the earliest)
43
# as the initial activity
0 commit comments