Bitwise operation only (with just one line)
Intuition\n Describe your first thoughts on how to solve this problem. \nConsider all situations of bitwise operation and results, you will find that the proble
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nConsider all situations of bitwise operation and results, you will find that the problem can be solved easily\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\na b c    result\n0 0 0 ->   0\n0 0 1 ->   1\n0 1 0 ->   1\n0 1 1 ->   0\n1 0 0 ->   1\n1 0 1 ->   0\n1 1 0 ->   2(but a XOR b XOR c = 0)\n1 1 1 ->   0(but a XOR b XOR c = 1)\n\nthe first 6 cases can be counted using XOR\nthe last 2 cases can be counted using a&b&(~c) and a&b&c respectively\nfinally, using builtin function popcount to count the number of 1\'s of integer in binary expression\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(1)\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(1)\n# Code\n```\nclass Solution {\npublic:\n    int minFlips(int a, int b, int c) {\n        return __builtin_popcount(a^b^c)+__builtin_popcount(a&b&(~c))*2-__builtin_popcount(a&b&c);\n    }\n};\n```
['Bit Manipulation', 'C++']