The sharpness of a word is the sum of the sharpness of each of its letters, using the following rules:
Veach have a sharpness of 1
Zeach have a sharpness of 2
Weach have a sharpness of 3
Ueach have a sharpness of -1
Shas a sharpness of -2
Ohas a sharpness of -3
All other letters have a sharpness of 0.
SAUCE has a sharpness of -3 since the
A contributes 1, the
C each contribute -1 and the
S contributes -2.
MAZE has a sharpness of 6 since the
M contributes 3, the
Z contributes 2, and the
A contributes 1.
Given as input a string containing only uppercase letters*, determine the sharpness of that string.
*If you wish, you may instead take the input as a string containing only lowercase letters. Other common input formats are also acceptable (eg. a list of characters, a list of codepoints, etc.)
This is code-golf!
CODE => -4 GOLF => -3 SAUCE => -3 CATS => -2 MOON => -1 NONSENSE => -1 ZUCKERBERG => 0 STRING => 0 CHALLENGE => 2 NAIL => 3 CARNIVAL => 4 COMPLIMENT => 4 WAVE => 5 UNKNOWN => 5 MAZE => 6
Extra test cases (Provided by @Surculose Sputum)
MIZZENMASTMAN => 17 PNEUMONOULTRAMICROSCOPICSILICOVOLCANOCONIOSIS => -26 MANAGEMENT => 12 CONSCIOUSNESS => -13