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 };