Super Simple || C++
Code\ncpp []\nclass Solution \n{\npublic:\n    vector<vector<int>> reconstructMatrix(int upper, int lower, vector<int>& colsum) \n    {\n        int n=colsum.si
# Code\n```cpp []\nclass Solution \n{\npublic:\n    vector<vector<int>> reconstructMatrix(int upper, int lower, vector<int>& colsum) \n    {\n        int n=colsum.size();\n        vector<vector<int>> grid(2, vector<int> (n,0));\n        for(int x=0; x<n; x++)\n        {\n            if(colsum[x]==2) \n            {\n                if(upper>0 && lower>0)\n                {\n                    grid[0][x]=grid[1][x]=1;\n                    upper--;\n                    lower--;\n                }\n                else\n                {\n                    vector<vector<int>> t;\n                    return t;   \n                }\n            }\n            else if(colsum[x]==1)\n            {\n                if(upper>0 && upper>lower)\n                {\n                    grid[0][x]=1;\n                    upper--;\n                }\n                else if(lower>0)\n                {\n                    grid[1][x]=1;\n                    lower--;\n                }\n                else\n                {\n                    vector<vector<int>> t;\n                    return t;\n                }\n            }\n        }\n        if(upper>0 || lower>0)\n        {\n            vector<vector<int>> t;\n            return t;\n        }\n        return grid;\n    }\n};\n```
['C++']