The Shortest Possible Javascript Solution
\n\nvar reconstructMatrix = function(upper, lower, colsum, total = upper + lower) {\n    const upperArr = colsum.map(v => v === 2 ? (upper--, 1) : 0).map((v, i)
\n```\nvar reconstructMatrix = function(upper, lower, colsum, total = upper + lower) {\n    const upperArr = colsum.map(v => v === 2 ? (upper--, 1) : 0).map((v, i) => colsum[i] === 1 && upper ? (upper--, 1) : v);\n    if (total !== colsum.reduce((x, y) => x + y) || upper) {\n        return [];\n    }\n    return [upperArr, colsum.map((v, i) => v - upperArr[i])];\n};\n```\n\n#### it\'s a challenge for you to explain how it works\n#### please upvote, you motivate me to solve problems in original ways
['JavaScript']