[C++], 100ms, faster than 100%
\nclass Solution {\npublic:\n    vector<vector<int>> reconstructMatrix(int upper, int lower, vector<int>& colsum) {\n        ios_base::sync_with_stdio(false);\n
```\nclass Solution {\npublic:\n    vector<vector<int>> reconstructMatrix(int upper, int lower, vector<int>& colsum) {\n        ios_base::sync_with_stdio(false);\n        cin.tie(NULL);\n        int n = colsum.size();\n        vector<vector<int> > res(2, vector<int>(n, 0));\n        int sumUp = 0, sumLo = 0;\n        for(int i = 0; i < n; i++)\n                if(colsum[i] == 2)\n                        res[0][i] = 1, res[1][i] = 1, sumUp++, sumLo++;\n        for(int i = 0; i < n; i++)\n        {\n            if(colsum[i] == 1)\n            {\n                if(sumUp < upper)\n                        res[0][i] = 1, sumUp++;\n                else\n                        res[1][i] = 1, sumLo++;\n            }\n        }\n        if(sumUp != upper || sumLo != lower)\n                return {};\n        return res;\n    }\n};\n```
[]