There are several boxes containing candy in front of Elly and Kris.
The girls play the following game.
Starting with Elly, they take alternating turns.
In each turn the girl whose turn it is takes one of the boxes and eats all the candies it contains.
Then the same number of candies as there were in the box that was just taken is added to each of the remaining boxes.
For example, let's imagine there are five boxes containing {40, 13, 17, 1, 11} candies.
If in the first turn Elly decides to take the second box, she will eat 13 candies and then the remaining boxes will contain {40+13, 17+13, 1+13, 11+13} = {53, 30, 14, 24} candies.
If then on the second turn Kriss takes the last box, she will eat 24 candies and after her turn the three remaining boxes will contain {77, 54, 38} candies.
The game is played until there are no more boxes.
The girl who has eaten more candies in total is declared the winner (and quite likely - a diabetic).
You are given the initial number of candies in each of the boxes in the int[] boxes. Assuming both girls play optimally, return "Elly", if Elly will win, "Kris", if Kris will win, or "Draw" if they will end up with the same score.
|