Efficient Python solution
python\nclass Solution:\n    def reconstructMatrix(self, upper: int, lower: int, colsum: List[int]) -> List[List[int]]:\n        if upper + lower != sum(colsum)
```python\nclass Solution:\n    def reconstructMatrix(self, upper: int, lower: int, colsum: List[int]) -> List[List[int]]:\n        if upper + lower != sum(colsum):\n            return []\n        n = len(colsum)\n        res = [[0]*n for _ in range(2)]\n        c_2 = 0\n        for i in range(n):\n            if colsum[i] == 2:\n                res[0][i], res[1][i] = 1, 1\n                c_2 += 1\n        \n        if c_2 > upper or c_2 > lower:\n            return []\n        \n        u, l = upper-c_2, lower-c_2\n        \n        for i in range(n):\n            if colsum[i] == 1:\n                if u > 0:\n                    res[0][i] = 1\n                    u -= 1\n                elif l > 0:\n                    res[1][i] = 1\n                    l -= 1\n        \n        return res\n```
[]