Earliest Time for a Fully-Colored Square

Asked at Amazon · Coding Questions · Difficulty: Hard

An `n x m` canvas starts white; at minute `i` the cell `paint[i]` (1-indexed row, col) turns black. Return the earliest minute at which some `k x k` square is entirely black.

Loading the problem…