High Low SupperPosition
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:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```javascript []\n/**\n * @param {number} upper\n * @param {number} lower\n * @param {number[]} colsum\n * @return {number[][]}\n */\nvar reconstructMatrix = function(upper, lower, colsum) {\n    let res = Array(2).fill(0).map(()=>Array(colsum.length).fill(0))\n    for(let sum = 0 ; sum < colsum.length ; sum++){\n        if(colsum[sum] === 2){\n            res[0][sum] = 1 \n            res[1][sum] = 1 \n            lower--\n            upper--\n        }else if(colsum[sum] === 0){\n            continue\n        }else if(colsum[sum] === 1){\n            if(lower <= upper){\n                res[0][sum] = 1\n                upper--\n            }else{\n                res[1][sum] = 1\n                lower--\n            }\n        }\n    }\n    if(lower !== 0 || upper !== 0){\n        return []\n    }\n    return res\n};\n```
['JavaScript']