A magic word is needed to open a box. On the outside of the box is an encrypted version of the magic word. This encoding is done on the base of a secret code that consist of a one-to-one mapping between the letters of the alphabet and a series of 26 integers.

magisch woord
Box showing a magic word that was encoded as a list of integers [9, 23, 14, 14, 18, 5].

Assignment

Write a function magicWord that takes two arguments: a list of integers and a string. The function must return a Boolean value that specifies whether or not the list of integers could be a valid encoding of the given word. Such an encoding must make use of a one-to-one mapping between the letters of the alphabet and a series of 26 integers, which is used to convert each letter of the magic word into its corresponding integer. The coding scheme does not distinguish between uppercase and lowercase letters.

Example

>>> magicWord([9, 23, 14, 14, 18, 5], 'winner')
True
>>> magicWord([9, 23, 14, 14, 18, 5], 'looser')
False
>>> magicWord([9, 23, 14, 14, 18, 5], 'zipper')
True
>>> magicWord([9, 23, 14, 14, 18, 5], 'hummus')
False