Python Elegant & Short | Enumeration
Complexity
Time complexity: O(n)
Space complexity: O(1)
Code
# Complexity
- Time complexity: $$O(n)$$
- Space complexity: $$O(1)$$

# Code
```python3 []
class Solution:
    def reverseDegree(self, string: str) -> int:
        degree = 0

        for idx, char in enumerate(string, start=1):
            degree += idx * (26 - ord(char) + ord('a'))

        return degree
```
['String', 'Enumeration', 'Python', 'Python3']