Problem Statement | |||||||||||||
Josh said every string with a certain property is his string. The property that Josh is talking about is that the sum of the letters of the string has to be a prime number. The string will contain only lowercase letters ('a'-'z'). For each letter you add to the sum the 1-based position of the letter in the alphabet. For 'a' you add 1, for 'b' you add '2', and so on. For example, the sum of the letters in "bad" is 2 + 1 + 4 = 7, and 7 is prime, so therefore, "bad" is Josh's string. Given a String s, return "YES" if it is Josh's string or "NO" otherwise (all quotes for clarity only). | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
- | s will contain only lowercase letters ('a'-'z'). | ||||||||||||
- | s will contain between 2 and 50 characters, inclusive. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
| |||||||||||||
4) | |||||||||||||
|