Beats 100% | counting |Easy Java Solution
\n\n# Code\n\nclass Solution {\n    public int scoreOfString(String s) {\n        int ans = 0;\n        \n        for(int i=0;i<s.length()-1;i++){\n            
\n\n# Code\n```\nclass Solution {\n    public int scoreOfString(String s) {\n        int ans = 0;\n        \n        for(int i=0;i<s.length()-1;i++){\n            ans+=Math.abs(s.charAt(i)-s.charAt(i+1));\n        }\n        return ans;\n    }\n}\n```
['Array', 'C', 'Python', 'C++', 'Java', 'TypeScript', 'Python3', 'Ruby', 'Kotlin', 'JavaScript']