Java dumb solution
\n\n\nclass Solution {\n    public List<List<Integer>> reconstructMatrix(int upper, int lower, int[] colsum) {\n        List<List<Integer>> matrix = new ArrayLi
\n\n```\nclass Solution {\n    public List<List<Integer>> reconstructMatrix(int upper, int lower, int[] colsum) {\n        List<List<Integer>> matrix = new ArrayList<>();\n        matrix.add(new ArrayList<>(colsum.length));\n        matrix.add(new ArrayList<>(colsum.length));\n    \n        for(int j = 0; j < colsum.length; j++){\n            if(colsum[j] == 0){\n                matrix.get(0).add(0);\n                matrix.get(1).add(0);\n            }else if(colsum[j] == 2){\n                matrix.get(0).add(1);\n                matrix.get(1).add(1);\n                upper--;\n                lower--;\n            }else if(colsum[j] == 1){\n                if(upper > lower){\n                    matrix.get(0).add(1);\n                    matrix.get(1).add(0);\n                    upper--;\n                }else{\n                    matrix.get(0).add(0);\n                    matrix.get(1).add(1);\n                    lower--;\n                }\n            }\n        }\n        \n        if(upper == 0 && lower == 0) return matrix;\n        else return new ArrayList<>();\n    }\n}\n```
[]