Score of a string
Intuition\nThe problem involves calculating the "score" of a string, where the score is defined as the sum of the absolute differences between the ASCII values 
# Intuition\nThe problem involves calculating the "score" of a string, where the score is defined as the sum of the absolute differences between the ASCII values of consecutive characters. This essentially measures how "different" adjacent characters are in terms of their ASCII values.\n\n# Approach\n1. **Initialize Score**: Start with a score of 0.\n2. **Iterate Through String**: Loop through the string from the first character to the second-to-last character.\n3. **Calculate Differences**: For each pair of consecutive characters, compute the absolute difference of their ASCII values.\n4. **Update Score**: Add the computed difference to the score.\n5. **Return Final Score**: After the loop, return the final score.\n\n# Complexity\n- **Time complexity**: \\(O(n)\\), where \\(n\\) is the length of the string. We iterate through the string once.\n- **Space complexity**: \\(O(1)\\), as we only use a few extra variables.\n\n# Code\n```java\nclass Solution {\n    public int scoreOfString(String s) {\n        int score = 0;\n        for (int i = 0; i < s.length() - 1; i++) {\n            score += Math.abs(s.charAt(i) - s.charAt(i + 1));\n        }\n        return score;\n    }\n}\n```\n\n### Explanation\n1. **Initialize Score**: `int score = 0;` initializes the score to 0.\n2. **Iterate Through String**: The for loop `for (int i = 0; i < s.length() - 1; i++)` iterates through each character in the string except the last one.\n3. **Calculate Differences**: Inside the loop, `Math.abs(s.charAt(i) - s.charAt(i + 1))` calculates the absolute difference between the ASCII values of the current character and the next character.\n4. **Update Score**: The result of the absolute difference is added to `score`.\n5. **Return Final Score**: After the loop completes, the total `score` is returned.\n\nThis approach efficiently calculates the desired score by leveraging the properties of ASCII values and absolute differences, making it straightforward and effective for strings of any length.
['String', 'Java']