-
-
Notifications
You must be signed in to change notification settings - Fork 86
Implement laptop allocation #179
Copy link
Copy link
Open
Labels
Module-ToolsThe name of the module.The name of the module.OptionalThis is an optional task to be attempted once trainees have completed core tasksThis is an optional task to be attempted once trainees have completed core tasksSubmit:PR🏕 Priority MandatoryThis work is expectedThis work is expected🐂 Size Medium1-4 hours1-4 hours📅 Sprint 5Assigned during Week 5 of this moduleAssigned during Week 5 of this module
Metadata
Metadata
Assignees
Labels
Module-ToolsThe name of the module.The name of the module.OptionalThis is an optional task to be attempted once trainees have completed core tasksThis is an optional task to be attempted once trainees have completed core tasksSubmit:PR🏕 Priority MandatoryThis work is expectedThis work is expected🐂 Size Medium1-4 hours1-4 hours📅 Sprint 5Assigned during Week 5 of this moduleAssigned during Week 5 of this module
In the prep, there was an exercise around finding possible laptops for a group of people.
Your exercise is to extend this to actually allocate laptops to the people.
Given these class definitions:
Write a function with this signature:
Every person should be allocated exactly one laptop.
If we define "sadness" as the number of places down in someone's ranking the operating system the ended up with (i.e. if your preferences were
[UBUNTU, ARCH, MACOS]and you were allocated a MACOS machine your sadness would be 2), we want to minimise the total sadness of all people. If we allocate someone a laptop with an operating system not in their preferred list, treat them as having a sadness of 100.Maximum time in hours
3
How to submit
Submit a PR to this repo containing your function (and any supporting code).