Reverse Degree String
IntuitionThe goal is to calculate a weighted score for a string where each character is given a "reverse alphabetical value" (i.e., 'a' = 26, 'b' = 25, ..., 'z'
# Intuition
The goal is to calculate a weighted score for a string where each character is given a "reverse alphabetical value" (i.e., 'a' = 26, 'b' = 25, ..., 'z' = 1), and that value is multiplied by its 1-based position in the string. This creates a kind of "reverse weighted degree" for the string.


# Approach
Iterate through the string character by character. For each character:
- Convert it into its reverse alphabetical value using: `26 - (ch - 'a')`.
- Multiply this value by the character's 1-based index in the string.
- Accumulate the result in a running sum.


# Complexity
- Time complexity:
O(n)

- Space complexity:
O(1)

# Code
```cpp []
class Solution {
public:
    int reverseDegree(string s) {
        int n = s.length();
        int productSum = 0;
        int i = 1;
        for(char ch:s)
        {
            productSum += (i*(26-(ch-'a')));
            i++;
        }

    return productSum;    
    }
};
```
['String', 'C', 'Simulation', 'C++', 'Java']