Lamps on a Huge Board
A square board has size rows and size columns, numbered from 0. Each item of lamps is a cell [row, col] with a lamp that is on; a cell listed twice still holds one lamp. A lamp lights its own cell and every cell in its row, in its column and on both of its diagonals.
checks lists cells to look at, in order. For each check: note whether the cell is lit, then switch off every lamp on that cell and on the 8 cells around it.
Return the notes as a list with 1 for lit and 0 for dark.
Example 1
The first check is lit by the lamp in row 1. The second check switches that lamp off, so the third finds the cell dark. The lamp at [4, 2] still lights column 2.
Example 2
The lamp lights the far corner along its diagonal. No check is next to the lamp, so it stays on. The last cell shares no line with it.
Constraints
1 <= size <= 10**90 <= len(lamps) <= 411 <= len(checks) <= 40- every cell is
[row, col]with0 <= row, col < size
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.