Ctrl K

Backward Alphabet Score

Easy
In a word game every letter gets a weight from the alphabet read backwards: a weighs 26, b weighs 25, …, z weighs 1. A word scores as follows: multiply each letter's weight by its position in the word (counting from 1) and add up all the products. Given a string word, return its score.
Example 1
word='yes' → 70

Backward-alphabet weights: y = 2, e = 22, s = 8. Total: 1·2 + 2·22 + 3·8 = 2 + 44 + 24 = 70.

Example 2
word='za' → 53

1·1 + 2·26 = 53.

Constraints
  • 1 ≤ word.length ≤ 1000
  • word consists of lowercase English letters only
Have you seen this problem in a real interview?
Solved by0
Tried by0
Submissions0
Acceptance—
loading Python…
Input
word='yes'
Expected
70

Run checks the first 3 tests in your browser. Submit checks all 57 tests on the server, hidden ones included.