✅✅Intuition + Solution with neat and clean code | C++ ✅✅
Intuition\n-  If the corresponding bit in the result c is 0, both a and b should have a 0 at that index.\n-  If the corresponding bit in the result c is 1, at l
# Intuition\n-  If the corresponding bit in the result c is 0, both a and b should have a 0 at that index.\n-  If the corresponding bit in the result c is 1, at least one of a and b should have a 1 at that index.\n\nTo fulfill this condition, the bits can be flipped accordingly.\n\nTo calculate the result, the following approach can be taken:\n- \n - If the bit in c is 0, the result is increased by the sum of bits in a and b at that index (i.e., ans += (ai + bi)).\n - If the bit in c is 1, the result is increased by the expression (ai != 1 && bi != 1) (if both ai and bi are not equal to 1, the value will be 1; otherwise, it will be 0).\n# Complexity\n- Time complexity:\n$$O(log(max(a,b,c)))$$\n\n- Space complexity:\n$$O(1)$$\n\n# Code\n```\nclass Solution {\npublic:\n    int minFlips(int a, int b, int c) {\n        int ans = 0;\n        while(a||b||c){\n            int aa = a%2;\n            int bb= b%2;\n            int cc = c%2;\n            if(cc==1){\n                ans += (aa!=1&&bb!=1);\n            }else{\n                ans += ((aa==1)+(bb==1));\n            }\n            a/=2;\n            b/=2;\n            c/=2;\n        }\n        return ans;\n    }\n};\n```
['Bit Manipulation', 'C++']