Simple code - Try this!
IntuitionWe are asked to compute a weighted sum where each character's weight is determined by its position in the reversed alphabet and its index in the origin
# Intuition
We are asked to compute a weighted sum where each character's weight is determined by its position in the reversed alphabet and its index in the original string.

Since the weights depend on both the character and its position, we can either compute them directly or reverse the string and adjust positions accordingly.

---


# Approach
Reverse the string using StringBuilder to match the order described in the problem.
For each character in the reversed string:

Compute its reversed alphabetical value: 'z' - ch + 1.
Compute its original position in the input string: s.length() - i.

Multiply both and add to the running total.
Return the total sum.


# Code
```java []
class Solution {
    public static int reverseDegree(String s) {
        
    	StringBuilder sb = new StringBuilder(s);
    	sb.reverse();
    	int sum = 0;
    	
    	for (int i = 0; i < sb.length(); i++) {
			
    		int val = sb.charAt(i);
    		
    		int reverse = 'z'-val+1;
    		int position = s.length() - i;
    	
    		sum += reverse * position;
		}
    	return sum;
    }
}
```
['Java']