n lamps each; every lamp is either on (1) or off (0). The picture itself is lost, and only the counters survived:
- top is the number of lamps that are on in the top row;
- bottom is the number of lamps that are on in the bottom row;
- column_lit[j] is the number of lamps that are on in column j (0 to 2).
Restore the board and return it as a list of two rows: the top row first, then the bottom one. If the counters contradict each other, return an empty list.
The input is guaranteed to allow at most one matching board.top=3, bottom=1, column_lit=[1, 2, 0, 1] → [[1, 1, 0, 1], [0, 1, 0, 0]]
Column 1 is fully lit, which uses one lamp in each row. The bottom row has nothing left, so the single lamps in columns 0 and 3 belong to the top row.
top=1, bottom=1, column_lit=[2, 1] → []
Three lamps are lit in total, but the rows account for only 1 + 1 = 2. No such board exists, so the answer is empty.
top=0, bottom=2, column_lit=[0, 1, 1] → [[0, 0, 0], [0, 1, 1]]
top=3, bottom=1, column_lit=[1, 2, 0, 1]
[[1, 1, 0, 1], [0, 1, 0, 0]]
Run checks the first 3 tests in your browser. Submit checks all 62 tests on the server, hidden ones included.