leetcode

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

2914.cpp (216B)


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