Easy java solution.. Beats 99%
IntuitionThe problem requires calculating the total difference between consecutive characters in a string. My first thought was to iterate through the string an

# Intuition  
The problem requires calculating the total difference between consecutive characters in a string. My first thought was to iterate through the string and compute the absolute difference between adjacent characters.  

# Approach  
1. Initialize a variable `sum` to store the total score.  
2. Iterate through the string from index `0` to `s.length() - 2`.  
3. For each character, compute the absolute difference between it and the next character.  
4. Add this difference to `sum`.  
5. Finally, return the accumulated `sum`.  

# Complexity  
- **Time complexity:** \(O(n)\) — Since we traverse the string once, where \(n\) is the length of the string.  
- **Space complexity:** \(O(1)\) — We use only a single integer variable to store the result, so extra space usage is constant.  

---
# Code
```java []
class Solution {
    public int scoreOfString(String s) {
        int sum = 0;
        for(int i = 0;i < s.length()-1;i++)
        {
            sum += Math.abs(s.charAt(i) - s.charAt(i+1)); 
        }
        return sum;
    }
}
```
['Java']