What will I practice?
In this puzzle, you have to manipulate large lists and use simple math concepts (e.g. min, max, average) to optimize the value of a variable.
External resourcesGreedy algorithm
Given a list of persons and their budgets, and the price of the present they wish to buy, you have to find the amount each person gives. You have to find this optimal distribution that minimize the highest contribution.
A higher resolution is required to access the IDE
The TARDIS time-and-space-ship lands on a strange planet. The local aliens, the Oods, want to make a present for a fellow Ood, but they can't seem a way to figure out how to manage everyone's budget. Help the Doctor find a system to decide the contribution of each Ood.
This exercise is the first presented for the challenge « Doctor Who ». If you like Doctor Who and want to try some harder puzzle, an other puzzle is available with Doctor Who, « Music Scores »