leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE

3110.cpp (207B)


      1 class Solution {
      2   public:
      3     int scoreOfString(const string &s) const {
      4         int res = 0;
      5         for (int i = 1; i < size(s); i++)
      6             res += abs(s[i] - s[i - 1]);
      7         return res;
      8     }
      9 };