c++| easy approach | understandable
```\nvector> reconstructMatrix(int upper, int lower, vector& colsum) {\n        \n        vector> ans(2,vector(colsum.size(),0));\n        for(int i=0;ilower)\n
```\nvector<vector<int>> reconstructMatrix(int upper, int lower, vector<int>& colsum) {\n        \n        vector<vector<int>> ans(2,vector<int>(colsum.size(),0));\n        for(int i=0;i<colsum.size();i++)\n        {\n            if(colsum[i]==1)\n            {\n                if(upper>lower)\n                {\n                    ans[0][i]=1;\n                    upper--; // 1 less sum of 0th row as we make the cell as 1\n                }\n                    \n                else\n                {\n                    ans[1][i]=1;\n                    lower--;  // 1 less sum of 1st row as we make the cell as 1\n                }\n                    \n            }\n            \n            if(colsum[i]==2)\n            {\n                    ans[0][i]=1;\n                    ans[1][i]=1;\n                    \n                upper--;   // 1 less sum of 0th row as we make the cell as 1\n                lower--;  // 1 less sum of 1st row as we make the cell as 1\n            }\n            \n            if(upper<0 or lower<0)  //sum exceeds of any row then not possible to form \n                return {};\n        }\n        \n        //0th row sum and 1st row sum should be completely made by forming the matrix\n        if(upper!=0 or lower!=0)  \n            return {};\n        \n        return ans;\n        \n    }
[]