From 57fbc0332e14de1a5ee7814159fb433c9ec5007a Mon Sep 17 00:00:00 2001 From: Hardik Pawar Date: Wed, 2 Oct 2024 12:42:24 +0530 Subject: [PATCH] Rename x to activity --- greedy_methods/activity_selection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/greedy_methods/activity_selection.py b/greedy_methods/activity_selection.py index ab5405ddb..6cdeff3d0 100644 --- a/greedy_methods/activity_selection.py +++ b/greedy_methods/activity_selection.py @@ -37,7 +37,7 @@ def activity_selection(activities: list[tuple[int, int]]) -> list[tuple[int, int """ # Step 1: Sort the activities by their end time - sorted_activities = sorted(activities, key=lambda x: x[1]) + sorted_activities = sorted(activities, key=lambda activity: activity[1]) # Step 2: Select the first activity (the one that finishes the earliest) # as the initial activity