[ C++ ] [ Using Bitset ] [ Easy Implementation ]
Code\n\nclass Solution {\npublic:\n    int minFlips(int a, int b, int c) {\n        bitset<32> A(a);\n        bitset<32> B(b);\n        bitset<32> C(c);\n\n    
# Code\n```\nclass Solution {\npublic:\n    int minFlips(int a, int b, int c) {\n        bitset<32> A(a);\n        bitset<32> B(b);\n        bitset<32> C(c);\n\n        string x=A.to_string();\n        string y=B.to_string();\n        string z=C.to_string();\n        \n        int res=0;\n        for(int i=31;i>=0;i--){\n            int a=x[i]-\'0\';\n            int b=y[i]-\'0\';\n            int c=z[i]-\'0\';\n            if((a or b)!=c){\n                if(c==0 and a==1 and b==1){\n                    res+=2;\n                }\n                else{\n                    res+=1;\n                }\n            }\n        }\n        return res;\n    }\n};\n```
['C++']