Iterate and sum
Code
Here is an article of my last interview experience - A Journey to FAANG Company, I recomand you to go through this to know which all resources I have used


# Code
```cpp []
int reverseDegree(string s) {
    int ans = 0;
    for(int i = 0; i < s.size(); ++i) ans += (26 - (s[i] - 'a'))*(i+1);
    return ans;
}
```
```Java []
int reverseDegree(String s) {
    int ans = 0;
    for(int i = 0; i < s.length(); ++i) ans += (26 - (s.charAt(i) - 'a'))*(i+1);
    return ans;
}
```




---

<span style="color:green">
<b>Here is an article of my last interview experience - A Journey to FAANG Company, I recomand you to go through this to know which all resources I have used & how I cracked interview at Amazon: </b> </span> 

https://leetcode.com/discuss/interview-experience/3171859/Journey-to-a-FAANG-Company-Amazon-or-SDE2-(L5)-or-Bangalore-or-Oct-2022-Accepted
 
---


['C++', 'Java']