Bit Manipulation [Easy C++ solution] Beats 100% (Upvote)
Approach\n Describe your approach to solving the problem. \nUsing Bit Manipulation. We first check whether the lsb of c is set or not.If it is set we know that 
# Approach\n<!-- Describe your approach to solving the problem. -->\nUsing Bit Manipulation. We first check whether the lsb of c is set or not.If it is set we know that 3 combinations can set it (01,10,11) and (00) can make it false so to verify this we check if both a and b lsb is 0 if it is then counter must be incremented.To do this we perform bit AND. The next condition is when c lsb is 0 so this condition is false in these condition (00,01,10) we check for this condition if both a and b are 1 then we need to set them both to 0 so counter must be increment by 2 in this case.\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n    O(log(max(a,b,c)))\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n    O(1)\n# Code\n```\nclass Solution {\npublic:\n    int minFlips(int a, int b, int c) {\n        int cnt=0;\n        while(c>0 || a>0 || b>0)\n        {\n            if(c&1)\n            {\n                if(!(a&1) && !(b&1))\n                {\n                    cnt++;\n                }\n            }\n            else\n            {\n                if(a&1 && b&1)\n                {\n                    cnt+=2;\n                }\n                else if((a&1 && !(b&1))||(!(a&1) && b&1))\n                {\n                    cnt++;\n                }\n            }\n            c>>=1;a>>=1;b>>=1;\n        }\n        return cnt;\n    }\n};\n```
['C++']