Santa's Decision:
In this challenge, you will help Santa Claus decide whether somebody on their list has been naughty or nice, and subsequently get coal
or toys
.
But unfortunately, Santa is unorganised, in some of his entries, the naughty
, nice
and name
fields are in the wrong order.
Input
Input will come in the following, interchangeable format:
- the person's name (cannot contain a colon, only
a-zA-Z0-9
) - the word
naughty
followed directly by a colon and an non-negative integer representing the amount of times Santa caught you being naughty - the word
nice
followed directly by a colon and an non-negative integer representing the amount of times Santa caught you being nice
All separated with a single whitespace (ASCII 32) between each of them.
Additionally, the name will have no whitespace between the parts of the name Santa Claus
-> SantaClaus
.
Bonus:
- (25%): He is Santa Claus, so he needs to check the list twice, and make sure there are no duplicates. (In which case, it just gets the first scores that user has)
Example:
Quill naughty:4 nice:0
naughty:0 Doorknob nice:3
naughty:2 Quill nice:6
nice:3 balpha naughty:3
pops nice:4 naughty:2
Output:
The output should consist of:
The name of the person followed by:
- If there's more points in
naughty
, thencoal
: - If there's more points in
nice
, thentoys
. But if
naughty
andnice
are equal, thenneeds more data
Example output:
- With organisation bonus and duplicate removal bonus:
Quill coal
Doorknob toys
balpha needs more data
pops toys
- Without bonus:
Quill coal
Doorknob toys
Quill toys
balpha needs more data
pops toys