✅[C++] || Simple Bit Manipulation Approach
Approach\n- Iterate over each bit of the numbers starting from the least significant bit.\n- Let\'s denote the least significant bits of a, b, and c as aa, bb, 
# Approach\n- Iterate over each bit of the numbers starting from the least significant bit.\n- Let\'s denote the least significant bits of a, b, and c as aa, bb, and cc, respectively.\n- Check if the bitwise OR of aa and bb is equal to cc. If they are equal, no bit flip is required to satisfy the condition (a OR b = c).\n- If the bitwise OR is not equal to cc, it means that at least one bit needs to be flipped to match the condition.\n- If the condition is not satisfied and cc is 1, then it means both aa and bb are 0. So, either aa or bb must be flipped to obtain 1. So, we increment the count by 1.\n- If the condition is not satisfied and cc is 0, then it means both aa and bb are 1. So, both aa and bb must be flipped to obtain 0. So, we increment the count by 2.\n\n# Dry Run\nLet\'s take a small example with `a = 5`, `b = 3`, and `c = 6`. \n\n1. Initialization:\n   - Iterating through the bits from right to left: \n     - `a = 101` (binary representation of 5)\n     - `b = 011` (binary representation of 3)\n     - `c = 110` (binary representation of 6)\n\n2. Loop / Bit Processing:\n   - Bit 0:\n     - `aa = 1`, `bb = 1`, `cc = 0`\n     - Since `aa | bb != cc`, we enter the if condition.\n     - `cc` is 0, and both `aa` and `bb` are 1. So, we increment `count` by 2.\n   - Bit 1:\n     - `aa = 0`, `bb = 1`, `cc = 1`\n     - Since `aa | bb == cc`, no bit flip is required.\n   - Bit 2:\n     - `aa = 1`, `bb = 0`, `cc = 1`\n     - Since `aa | bb == cc`, no bit flip is required.\n\n3. Final Result:\n   - `count = 2` (minimum number of bit flips required)\n\n# Code\n```\nclass Solution {\npublic:\n    int minFlips(int a, int b, int c)\n    {\n        int count = 0;\n\n        while(a || b || c)\n        {\n            int aa = a&1;\n            int bb = b&1;\n            int cc = c&1;\n\n            if((aa | bb) != cc)\n            {\n                if(cc == 1)\n                    count += 1;\n                else\n                {\n                    count += (aa == 1) ? (1) : (0);\n                    count += (bb == 1) ? (1) : (0);\n                }\n            }\n\n            a /= 2;\n            b /= 2;\n            c /= 2;\n        }\n\n        return count;\n    }\n};\n```\n\n> **NOTE:** \nThe addition of parentheses in the expression `(aa | bb) != cc` is necessary to control the order of evaluation. Without parentheses, the `!=` operator has higher precedence than the `|` operator, leading to incorrect evaluation of the expression. By using parentheses, we ensure that the bitwise OR operation (`|`) is performed first, followed by the comparison with `cc`. This ensures that the desired logic of the code is maintained and the correct comparison is made between the bitwise OR result and `cc`.\n\n# Complexity\n- Time complexity: $ O(log(max(a, b, c))) $\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)$$ -->
['Bit Manipulation', 'C++']