BEST OPTIMAL SOLUTION✅✅
Complexity
Time complexity: O(N)

Space complexity: O(1)
Code

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

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

# Code
```cpp []
class Solution {
public:
    int getRevAlpha(char ch){
        ch = tolower(ch);
        return (ch >= 'a' && ch <= 'z')? (26 - (ch - 'a')) : 0;
    }
    int reverseDegree(string s) {
        int sum = 0;
        for (int i=0; i<s.length(); i++){
            int revPos =  getRevAlpha(s[i]);
            int indexString = i + 1;
            sum += revPos * indexString;
        }
        return sum;
    }
};
```
['String', 'String Matching', 'Enumeration', 'C++']