O(1) TIME AND SPACE | EASY SOLUTION IN C++
Intuition\n- Checking each bit of a, b, and c from the most significant bit (MSB) to the least significant bit (LSB).\n- If the corresponding bit in c is 1, we 
# Intuition\n- Checking each bit of a, b, and c from the most significant bit (MSB) to the least significant bit (LSB).\n- If the corresponding bit in c is 1, we need to ensure that either a or b has a corresponding bit as 1. If not, a flip operation is required.\n- If the corresponding bit in c is 0, we need to ensure that both a and b have the corresponding bit as 0. If not, a flip operation is required.\n\n# Approach\n- Convert **a**, **b**, and **c** into binary representations using **bitset<32>**.\n- Initialize a **count** variable to keep track of the number of flips required.\n- Iterate over each bit from the MSB to the LSB (from index 31 to 0):\n- If **c1[i]** is 1:\n  - If both **a1[i]** and **b1[i]** are 0, increment **count** since a flip is required.\n- If **c1[i]** is 0:\n  - If either **a1[i]** or **b1[i]** is 1, increment **count** since a flip is required.\n  - If both **a1[i]** and **b1[i]** are 1, increment **count** by 2 since two flips are required.\n- Return the final **count** as the minimum number of flips required.\n\n# Complexity\n- Time complexity: **O(1)**\n\nThe code performs a constant number of operations regardless of the input size.\nIt involves a single loop iterating over 32 bits, which is a fixed number.\n\n - Space complexity: **O(1)**\n\nThe code uses a constant amount of extra space to store the bitsets and the count variable.\nThe space used does not depend on the input size.\n\n# Code\n```\nclass Solution {\npublic:\n\n    int minFlips(int a, int b, int c) {\n       bitset<32> a1(a);\n       a1.to_string();\n\n       bitset<32> b1(b);\n       b1.to_string();\n\n       bitset<32> c1(c);\n       c1.to_string();\n\n       int count = 0;\n\n       for(int i = 31; i>=0; i--){\n           if(c1[i]==1){\n               if(a1[i]==0 && b1[i]==0){\n                   count++;\n               }\n           }\n           else{\n               if((a1[i]==0 && b1[i]==1) || (a1[i]==1 && b1[i]==0)){\n                   count++;\n               }\n               if(a1[i]==1 && b1[i]==1){\n                   count += 2;\n               }\n           }\n       }\n       return count; \n    }\n};\n```\nUPVOTE :)
['C++']