[Python] concise dp solution - O(N) / O(N)
dp[i][j] means the number of flips it takes to make s[:j+1] an alternating sequence ending with i. \n\nCompared with the sliding window solution, the DP solutio
`dp[i][j]` means the number of flips it takes to make `s[:j+1]` an alternating sequence ending with `i`. \n\nCompared with the sliding window solution, the DP solution is harder to understand. Just put it here for reference.\n\n```Python\nclass Solution:\n    def minFlips(self, s: str) -> int:\n        n = len(s)\n        dp = [[0] * n for _ in range(2)]\n        dp[1-int(s[0])][0] = 1\n        for i in range(1, n):\n            dp[0][i] = dp[1][i-1] + (s[i] == \'1\')\n            dp[1][i] = dp[0][i-1] + (s[i] == \'0\')\n        \n        ans = min(dp[0][-1], dp[1][-1])\n        for i in range(n - 1):\n            ans = min(ans, dp[0][i] + (dp[1-i%2][-1] - dp[n%2][i]))\n            ans = min(ans, dp[1][i] + (dp[i%2][-1] - dp[1-n%2][i]))\n        return ans\n```
[]