Solution for Score of a String
IntuitionI thought about creating an array and storing all the ascii values of the characters and then using them to evaluate the score.ApproachI did the questi
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
I thought about creating an array and storing all the ascii values of the characters and then using them to evaluate the score.

# Approach
<!-- Describe your approach to solving the problem. -->
I did the question using Brute-Force Approach.
First we create an array to store all the ascii values of each character in the string "s". 
After that all that we would need is to calculate the score with the given method: 

```.
Sum of Absolute Difference between Adjacent characters
```

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

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

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