C++ code || bit manipulation || simple comparison
Intuition\ncompare a|b with c bit by bit\n\n# Approach\n1- calculate a|b\n2- check the bits of a|b is different from c\n\n    2.1- if a|b==1 for that bit then\n
# Intuition\ncompare a|b with c bit by bit\n\n# Approach\n1- calculate a|b\n2- check the bits of a|b is different from c\n\n    2.1- if a|b==1 for that bit then\n\n        2.1.1- if bits of a and b are 1 then increment by 2\n        2.1.2- else increment by 1\n    2.1-else increment by 1\n\n# Complexity\n- Time complexity: $$O(32)$$ \n\n- Space complexity: $$O(1)$$ \n\n# Code\n```\nclass Solution {\npublic:\n    int minFlips(int a, int b, int c) {\n        int newc=a|b;\n        int ans=0;\n        \n        for(int i=0;i<32;i++){\n            if((c&(1<<i)) != (newc &(1<<i))){\n                if((newc&(1<<i))>0){\n                    if((a&(1<<i))==(b&(1<<i))) \n                    ans+=2;\n                    else ans+=1;\n                    }\n                else ans+=1;\n            }\n        }\n        return ans;\n    }\n};\n```
['Bit Manipulation', 'C++']