#C9755. Calculate the Weight of a String
Calculate the Weight of a String
Calculate the Weight of a String
Given a string s
consisting of only lowercase English letters, compute its weight where the weight is defined as the sum of the positions of the letters in the alphabet. For example, the weight of the string "abc" is computed as:
\(1 + 2 + 3 = 6\)
Return the computed weight.
Note: If the input string is empty, the weight is 0.
inputFormat
The input consists of a single line containing a string s
, which contains only lowercase English letters (possibly an empty string).
outputFormat
Output a single integer representing the weight of the string.
## sampleabc
6