Beats 100% ✅C++ Easy to Understand
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
```cpp []
class Solution {
public:
    int scoreOfString(string s) {
        int answer = 0;
        for(int i = 0; i < s.size() - 1; i++){
            int sum = 0;
            sum = abs(s[i] - s[i+1]);
            answer += sum;
        }
        return answer;
    }
};
```
['C++']