Skip to content

Commit f599d9b

Browse files
committed
convert best_scenario_Assignment to a dictionary {perspn:laptop}
1 parent 73156dd commit f599d9b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

implement-laptop-allocation/main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,7 @@ def allocate_laptops(people: List[Person], laptops: List[Laptop]) -> Dict[Person
5050
best_total_sadness = total_sadness
5151
best_scenario_assignment = scenario
5252

53+
# Convert best_scenario_assignment into Dict[Person, Laptop]
54+
return {person: laptop for person, laptop in zip(people, best_scenario_assignment)}
55+
5356

0 commit comments

Comments
 (0)