[Python3] straightforward
\nclass Solution:\n    def reconstructMatrix(self, upper: int, lower: int, colsum: List[int]) -> List[List[int]]:\n        res = [[0] * len(colsum) for _ in ran
```\nclass Solution:\n    def reconstructMatrix(self, upper: int, lower: int, colsum: List[int]) -> List[List[int]]:\n        res = [[0] * len(colsum) for _ in range(2)]\n        for j, sm in enumerate(colsum):\n            if sm == 2:\n                if upper == 0 or lower == 0:\n                    return []\n                upper -= 1\n                lower -= 1\n                res[0][j] = res[1][j] = 1\n            elif sm:\n                if upper == lower == 0:\n                    return []\n                if upper >= lower:\n                    upper -= 1\n                    res[0][j] = 1\n                else:\n                    lower -= 1\n                    res[1][j] = 1\n        return res if upper == lower == 0 else []\n```
[]