Easy  and Simple Solution In JS
```\n/*\n * @param {number} upper\n * @param {number} lower\n * @param {number[]} colsum\n * @return {number[][]}\n /\nvar reconstructMatrix = function(upper, l
```\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 dp = new Array(2)\n   for(let i  = 0; i< dp.length; i++){\n      dp[i] = new Array(colsum.length)\n  }\n  let first = upper\n  let second = lower\n    let upsum = 0\n    let losum=  0\n    \n     for(let i = 0; i<  colsum.length; i++){\n         if(colsum[i] === 2){\n             dp[0][i] = 1\n             dp[1][i] = 1\n             upsum++\n             losum++\n         }\n         else if(colsum[i] === 1){\n             if(lower < upper){\n                 dp[0][i] =1\n                 dp[1][i] = 0\n                 upper--\n                 upsum++\n             }\n             else{\n                 dp[0][i] = 0\n                 dp[1][i] = 1\n                 lower--\n                 losum++\n             }\n         }\n         else if(colsum[i] === 0){\n             dp[0][i]  = 0\n             dp[1][i] = 0\n         }\n         else{\n             return []\n         }\n     }\n     if(losum !== second || upsum !== first) return []\n return dp\n}
['JavaScript']