Given a single word as input, determine if the word is odd or even.
Odd and Even words
Assume the general rules:
odd + odd = even even + odd = odd odd + even = odd even + even = even
In the alphabet, the odd letters are:
And the even letters are:
The same applies to capital letters (
AEIOU are odd and
BCDFGHJKLMNPQRSTVWXYZ are even).
You then 'add' each of the letters in the word together. For example, the word
cats is equivalent to:
even + odd + even + even
Which simplifies to:
odd + even
Which simplifies further to:
So the word
cats is odd.
Input: trees Output: even
Input: brush Output: odd
Input: CAts Output: odd
Input: Savoie Output: even
Input: rhythm Output: even
All input will be a single word which will only contain alphabetical characters.
If the word is odd, output a truthy value. If the word is even, output a falsey value.
The shortest code in bytes wins.