Reverse Degree of a String - 💯Beats 100.00% || C++✅✔️
Complexity
Time complexity:

Space complexity:
Code
![image.png](https://assets.leetcode.com/users/images/4f62472a-044d-4423-877c-d74aa6f6409e_1743624245.204129.png)

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->
    O(n)
- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->
    O(1)

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