python greedy
idea: fill columns of sum 2 first, then 1.\n\n    def reconstructMatrix(self, upper: int, lower: int, colsum: List[int]) -> List[List[int]]:\n        if sum(col
idea: fill columns of sum 2 first, then 1.\n```\n    def reconstructMatrix(self, upper: int, lower: int, colsum: List[int]) -> List[List[int]]:\n        if sum(colsum) != upper + lower:\n            return []\n        COL = len(colsum)\n        res = [[0] * COL for _ in range(2)]\n        \n        for i in range(COL):\n            if colsum[i] == 2:\n                upper -= 1\n                lower -= 1\n                res[0][i] = res[1][i] = 1\n        for i in range(COL):\n            if colsum[i] == 1:\n                if upper:\n                    upper -= 1\n                    res[0][i] = 1\n                else:\n                    lower -= 1\n                    res[1][i] = 1\n        return res if upper == 0 and lower == 0 else []\n```
['Python3']