Ad
  • Custom User Avatar

    For the test case n_goblins=9, n_spiders=8 I see many different implementations:

    • one says: 8 or more spiders -> convert all goblins to Spidy-Gobs -> resulting power is 72
    • another: 8 or more spiders -> turn only as many goblins to Spidy-Gobs as we have spiders, ignore the rest -> resulting power is 64
    • third: 8 or more spiders -> turn only as many goblins to Spidy-Gobs as we have spiders, take the rest normal goblins -> resulting power is 65

    For some reason all of these 3 iterpretations pass the tests.

    EDIT: Well, that was easy...

    answer = optimal_battle_strategy(number_goblins, number_spiders)
    test.assert_equals(optimal_battle_strategy(number_goblins, number_spiders), answer)
    
  • Custom User Avatar
    • Why all spiders are not counted, if used as multiplier? Only a subset of spiders should be used as multiplier?
    • Why condition about minimum of 8 spiders?
    • It is not explicitly mentioned, that base power of all units is the same. You have to operate in numbers, if the end task is in numbers.
  • Custom User Avatar

    I don't understand this: "In order to turn into a Spidy-Gob, there needs to be a minimum of 8 spiders". Does it mean that to turn into a monstrous spidy-gob:

    • a goblin has to put at least eight spiders on its head, or maybe
    • there needs to be at least eight spiders in the whole team, but it's enough to put a single spider on a goblin's head?

    BTW I love the theme, spidy-gobs are scary as hell!