leetcode

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

1529.cpp (276B)


0 class Solution {
1 public:
2 int minFlips(const string &target) {
3 int res = 0, looking = 1;
4 for (const char c : target) {
5 if ((c & 1) != looking) continue;
6 looking = !looking;
7 res++;
8 }
9 return res;
10 }
11 };