my simple python 5 lines of code method 
Intuitionnumber of errors for "01..." alternate is len(s) - number of errors for "10..."
and after flipping the new string errors for "01.." are equal to the er
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
number of errors for "01..." alternate is len(s) - number of errors for "10..."
and after flipping the new string errors for "01.." are equal to the errors comparision of "10..." of the last string before flipping

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
$$O(n)$$

- Space complexity:
 $$O(1)$$

# Code
```python3 []
class Solution:
    def minFlips(self, s: str) -> int:
        a=sum( i != str(index%2)for index,i in enumerate(s) )
        minf=min(a,len(s)-a)
        for i in range(len(s)):
            a= (len(s)-a + (s[i]!=str((len(s)-1)%2) ) - (s[i]=="0"))
            minf =min(minf,a,len(s)-a)
        return minf
        
        
```
['Python3']