Beats 100% O(N) Bit Manipulation and Shifting
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\nJust bit shifting.\n Describe your approach to solving the problem. \n\n#
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\nJust bit shifting.\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: $$O(N)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(1)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int minFlips(int a, int b, int c) {\n        int tmp = a|b;\n        if(tmp == c){\n            return 0;\n        }\n        int mask = 1;\n        int ans = 0;\n        for(int i=0; i<32; i++) {\n            int aBit = ((1 << i) & a) >> i;\n            int bBit = ((1 << i) & b) >> i;\n            int cBit = ((1 << i) & c) >> i;\n            tmp = aBit | bBit;\n            if(tmp == cBit){\n                continue;\n            }\n            if(cBit == 0) {\n                ans+=aBit;\n                ans+=bBit;\n            }\n            else {\n                ans++;\n            }\n        }\n        return ans;\n    }\n}\n```
['Bit Manipulation', 'Java']