Input: A string
Output: The rarity of the string, as described below.
To find the rarity of a string, follow the steps below.
- Start with 0.
- Subtract 3 for each E, A, T, or O in the string.
- Subtract 2 for each I, N, S, or H in the string.
- Subtract 1 for each R, D, L, or C in the string.
- Add 1 for each W, F, G, or Y in the string.
- Add 2 for each K, V, B, or P in the string.
- Add 3 for each J, Q, X, or Z in the string.
This is code-golf. The shortest answer in bytes wins!
- The input only consists of lowercase letters.
- The input is guaranteed to be non-empty.
- For U and M, do nothing.
- The text can be in any format.