Fast and short solution
Approach
ord(c) gives the ASCII value of the character c.

ord('z') gives the ASCII value of 'z'.
The difference ord('z') - ord(c) gives the distance from 'z',
# Approach
1. ord(c) gives the ASCII value of the character c.
- ord('z') gives the ASCII value of 'z'.
- The difference ord('z') - ord(c) gives the distance from 'z', and adding 1 converts it to a 1-indexed system where 'a' corresponds to 26 and 'z' corresponds to 1.

2. The expression (i + 1) adjusts the index to be 1-indexed, as required by the problem statement.


# Complexity
- Time complexity:
$$O(n)$$, where n is the length of the string s. This is because the solution processes each character exactly once to compute the total.

- Space complexity:
$$O(1)$$ because the solution uses a constant amount of extra space.

# Code
```python3 []
class Solution:
    def reverseDegree(self, s: str) -> int:
        return sum((ord('z') - ord(c) + 1) * (i + 1) for i, c in enumerate(s))
        
```
``` javascript []
/**
 * @param {string} s
 * @return {number}
 */
var reverseDegree = function(s) {
    let total = 0;
    for (let i = 0; i < s.length; i++) {
        total += ('z'.charCodeAt(0) - s.charCodeAt(i) + 1) * (i + 1);
    }
    return total;
};
```
``` php []
class Solution {

    /**
     * @param String $s
     * @return Integer
     */
    function reverseDegree($s) {
        $total = 0;
        for ($i = 0; $i < strlen($s); $i++) {
            $total += (ord('z') - ord($s[$i]) + 1) * ($i + 1);
        }
        return $total;
    }
}
```
['Math', 'String', 'PHP', 'Python3', 'JavaScript']