reverse-degree-of-a-string || very easy solution || JS
Complexity
Time complexity:O(N)

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

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

# Code
```javascript []
/**
 * @param {string} s
 * @return {number}
 */
var reverseDegree = function(s) {
     let sum=0
     for(let i=0;i<s.length;i++){
     let itm=97-s.charCodeAt(i)+26
     sum+=itm*(i+1)
   } 
     return sum

};
```
['JavaScript']