All submissions for this problem are available.
Ravi has fallen in love with Riya. As he is my best friend, I am the only person who knows it and of course I am not going to tell you how this happened :D
He starts messaging Riya as everyone does and soon realizes that his fingers are unable to type any more. He decides to reduce his work from the next day. He got an idea about how to calculate the overhead required to type a particular message. His mobile contains only one button and he needs to press the button based on the rank of a letter (only lower case letters are used) i.e. if he wants to type the letter ‘c’ he needs to press the button 3 times. Ravi wants your help to decide the total overhead of typing a particular string.
The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows. The only line of each test case contains a string S.
For each test case, output only line containing the total overhead.
- 1 ≤ T ≤ 10000
- 1 ≤ |S| ≤ 1000
Input: 2 acd abcde Output: 8 15
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, PYP3, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.