Easy to Understand - If-Else solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    vector<vector<int>> reconstructMatrix(int upper, int lower, vector<int>& colsum) {\n        int u=0, l = 0;\n        vector<vector<int>> ans(2, vector<int>(colsum.size(), 0));\n        for(int i =0; i<colsum.size(); i++){\n            if(colsum[i] == 0){\n                ans[0][i] = 0;\n                ans[1][i] = 0;\n            }\n            else if(colsum[i] == 2){\n                ans[0][i] = 1;\n                ans[1][i] = 1;\n                u = u + ans[0][i];\n                l = l + ans[1][i];\n            }\n            else if(colsum[i] == 1) {\n                if(upper - u > lower - l) {\n                    ans[0][i] = 1;\n                    u += 1;\n                } else {\n                    ans[1][i] = 1;\n                    l += 1;\n                }\n            }\n        }\n        if(u != upper || l != lower) {\n            return {};\n        }\n        return ans;\n    }\n};\n```
['C++']