🔥Beats 100% - Brute Force | Clean Code | C++ |
Code\n\nclass Solution {\npublic:\n    int scoreOfString(string s) {\n        int res = 0;\n        for (int i = 1; i < s.size(); i++)\n        {\n            r
# Code\n```\nclass Solution {\npublic:\n    int scoreOfString(string s) {\n        int res = 0;\n        for (int i = 1; i < s.size(); i++)\n        {\n            res += abs(s[i] - s[i - 1]);\n        }\n\n        return res;\n    }\n};\n```
['C++']