Very short solution. 44ms
Very short solution. 44ms\n\n# Code\n\nint maximumGood(vector<vector<int>>& statements) {\n    bitset<16> assume=0;\n    function<int(int, bool, int)> dfs = [&]
Very short solution. 44ms\n\n# Code\n```\nint maximumGood(vector<vector<int>>& statements) {\n    bitset<16> assume=0;\n    function<int(int, bool, int)> dfs = [&](int i, bool good, int cur) {\n        //if(i == statements.size()) return cur-1;\n        assume[i] = good; // good/bad\n        for(int k=0; k<i; k++)  // only check i\n            if((statements[k][i]!=2 && assume[k] && statements[k][i]!=assume[i]) ||\n            (statements[i][k]!=2 && assume[i] && statements[i][k]!=assume[k]))\n            return 0;\n        if(i == statements.size()-1) return cur;\n        return max(dfs(i+1, true, 1+cur), dfs(i+1,false, cur));\n    };\n    return max(dfs(0, true, 1), dfs(0, false, 0));\n}\n```
['C++']