Halloween Monsters Halloween Monsters
Simple
English

You have to call the monsters from another world in preparation for Halloween.

You are given a string as an input value. You have to use it to make monster names and return the maximum number. You can call only 9 kinds of monsters:

  • frankenstein
  • ghost
  • jack
  • mummy
  • skeleton
  • vampire
  • werewolf
  • witch
  • zombie
NOTE:
  • You can make multiple monster names of the same kind.
  • You don't need to use all the characters.
  • If you can't make a monster name, return 0.

Example:

halloween_monsters('tkjagchso') == 2               # jack, ghost
halloween_monsters('finhtiistchwwaerecnnkt') == 3  # witch, witch, frankenstein

Input: The spell (a string).

Output: A number of monsters (an integer).

Precondition:

  • all(re.fullmatch('[a-z]', i) for i in input)
  • len(input) ≤ 100

How it is used: To calculate materials and products.