Java Solution Runtime Beats 99.43% Memory Beats 91.84%
ApproachConverting string to CharArray to find char faster by indexComplexity
Time complexity: O(n)

Space complexity: O(n) and still faster:)
Code
<!-- # Intuition -->
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
Converting string to CharArray to find char faster by index 
<!-- Describe your approach to solving the problem. -->

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

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

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