[Java] O(1) time & O(1) space
```\nclass Solution {\n    public int minFlips(int a, int b, int c) {\n        int count = 0;\n        for(int i = 1; i <= 32; i++) {\n            int b1 = 0, b
```\nclass Solution {\n    public int minFlips(int a, int b, int c) {\n        int count = 0;\n        for(int i = 1; i <= 32; i++) {\n            int b1 = 0, b2 = 0, b3 = 0;\n            if(((a >> (i - 1)) & 1) >= 1) b1 = 1; // check the ith bit of a\n            if(((b >> (i - 1)) & 1) >= 1) b2 = 1; // check the ith bit of b\n            if(((c >> (i - 1)) & 1) >= 1) b3 = 1; // check the ith bit of c\n            if(b3 == 0 && (b1 == 1 || b2 == 1)) count += b1 + b2; // if the ith bit of c is 0 and any of the ith bits of a or b is 1\n            else if(b3 == 1 && b1 == 0 && b2 == 0) count++; // if the ith bit of c is 1, check the ith bits of a and b\n        }\n        return count;\n    }\n}
[]