Simple C++ Solution | Strings | O(n)
IntuitionComplexity

Time complexity:
O(n)


Space complexity:
O(1)

Code
# Intuition
https://youtu.be/eY5WeKfq3js

# Complexity
- Time complexity:
$$O(n)$$

- Space complexity:
$$O(1)$$

# Code
```cpp []
class Solution {
public:
    int reverseDegree(string s) {
        int n = s.length();
        int result = 0;
        for(int i = 0; i < n; i++){
            result += ('z' - s[i] + 1) * (i+1);
        }
        return result;
    }
};
```
['C++']