97% speed and 100% memory
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:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```python3 []\nclass Solution:\n    def reconstructMatrix(self, upper: int, lower: int, colsum: List[int]) -> List[List[int]]:\n        c=Counter(colsum)\n        if c[2]>upper or c[2]>lower:\n            return []\n        if max(upper,lower)+c[0]>len(colsum):\n            return []\n        res=[[-1]*len(colsum) for i in range(2)]\n        for i,s in enumerate(colsum):\n            if s==2:\n                res[0][i],res[1][i]=1,1\n                upper-=1\n                lower-=1\n            elif s==0:\n                res[0][i],res[1][i]=0,0\n        for i,s in enumerate(colsum):\n            if s==1:\n                if upper:\n                    res[0][i],res[1][i]=1,0\n                    upper-=1\n                elif lower:\n                    res[0][i],res[1][i]=0,1\n                    lower-=1\n                else:\n                    return []\n        return res if upper==lower==0 else []\n        \n\n\n```
['Python3']