[Python] Simple and intuitive bit manipulation 🤙 | 1 line
Intuition\n\n\nThere are only three scenarios that require flipping.\n\n- c == 1\n    - if a == 0 and b == 0: flip a or b to 1\n- c == 0\n    - if a == 1: flip 
# Intuition\n![\u5716\u7247.png](https://assets.leetcode.com/users/images/d5a1795e-3a81-4104-877c-6d2905a6f2d0_1686158697.2263498.png)\n\nThere are only three scenarios that require flipping.\n\n- c == 1\n    - if a == 0 and b == 0: flip a or b to 1\n- c == 0\n    - if a == 1: flip a to 0\n    - if b == 1: flip b to 0\n\n\n# Code\n```\n# c == 1 and a == 0 and b == 0\n# means c and not(a) and not(b) \n# The flip count is how many "1" in bin(c & ~a & ~b)\nbin(c & ~a & ~b).count("1")\n\n# c == 0 and a == 1\n# means not(c) and a\nbin(~c & a).count("1")\n\n# c == 0 and b == 1\n# means not(c) and b\nbin(~c & b).count("1")\n```\n```\nclass Solution:\n    def minFlips(self, a: int, b: int, c: int) -> int:\n        return bin(c & ~a & ~b).count("1") + bin(~c & a).count("1") + bin(~c & b).count("1")\n\n```
['Python3']