3498 - Reverse Degree Of A String
Intuitionresult += (26 - (s.charAt(i) - 'a')) * (i + 1);Approachresult += (s.charAt(i) - 123) * -(i + 1);Complexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
result += (26 - (s.charAt(i) - 'a')) * (i + 1);

# Approach
<!-- Describe your approach to solving the problem. -->
result += (s.charAt(i) - 123) * -(i + 1);

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

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

# Code
```java []
class Solution {
    public int reverseDegree(String s) {
        int result = 0;
		int len = s.length();
		for (int i = 0; i < len; i++) {
			result += (s.charAt(i) - 123) * -(i + 1);
		}
		return result;
    }
}
```
['Java']