C++ beats 100%
C++ beats 100%\n\n\n\n# Code\n\nclass Solution {\npublic:\n    int scoreOfString(string s) {\n        int sum = 0;\n        for(int i = 0; i+1 <= s.size()-1;i++
C++ beats 100%\n![image.png](https://assets.leetcode.com/users/images/0daf048f-f835-401c-b702-934aea9153a2_1717218990.0708005.png)\n\n\n# Code\n```\nclass Solution {\npublic:\n    int scoreOfString(string s) {\n        int sum = 0;\n        for(int i = 0; i+1 <= s.size()-1;i++){\n            int a = s[i];\n            int b = s[i+1];\n            if (a > b){\n                sum += a-b;\n            }\n            else{\n                sum += b -a;\n            }\n        }\n        return sum;\n    }\n};\n```
['C++']