easy solution | beats 100%
Intuition\nThe problem involves finding the minimum number of bit flips required to convert integers a and b into c.\n\n# Approach\n\n1. Initialize a variable c
# Intuition\nThe problem involves finding the minimum number of bit flips required to convert integers a and b into c.\n\n# Approach\n\n1. Initialize a variable `count` to track the number of bit flips required.\n2. Find the maximum of `a`, `b`, and `c` to determine the number of iterations needed for bitwise operations.\n3. Iterate through each bit of `a`, `b`, and `c` simultaneously, starting from the least significant bit.\n4. Within each iteration:\n    - Check if the current bit of `c` is set (1):\n        - If both the corresponding bits of `a` and `b` are unset (0), increment the `count`.\n    - If the current bit of `c` is unset (0):\n        - If either `a` or `b` has its corresponding bit set (1), increment the `count`.\n        - If both `a` and `b` have their corresponding bits set (1), increment the `count` by 2.\n5. Right shift `a`, `b`, and `c` to move to the next bit.\n6. Repeat steps 3-5 until all bits are processed.\n7. Return the final `count` representing the minimum number of bit flips required. \n\n# Complexity\n- Time complexity: \\( O(n) \\), where \\( n \\) is the number of bits in the integers `a`, `b`, and `c`.\n- Space complexity: \\( O(1) \\), as the algorithm only uses a constant amount of extra space regardless of the input size.\n\n# Code\n```\nclass Solution {\npublic:\n    int minFlips(int a, int b, int c) {\n        int maxi = max(max(a,b),c) ;\n        int count = 0 ;\n        while (maxi){\n            if (c & 1){\n                if (!((a & 1) || (b & 1))) count++ ;\n            }\n            else {\n                if ((a & 1) && (b & 1)) count += 2 ;\n                else if ((a & 1) || (b & 1)) count++ ;\n            }\n            a >>= 1 ;\n            b >>= 1 ;\n            c >>= 1 ;\n            maxi >>= 1 ;\n        }\n        return count ;\n    }\n};\n```
['Bit Manipulation', 'C++']