Back to problems

Lighthouse Light Propagation

Algorithm · Pinterest · Medium

Requirements Use the following Python interface: The input grid is rectangular with rows rows and columns columns. A cell contains # for a wall, L for a lighthouse, or . for an empty cell. directions maps each lighthouse's zero-based (row, column) position to one or more (row_delta, column_delta) direction vectors. A wall is a cell marked #; it blocks a ray, so the ray does not continue into or beyond that cell. The function returns the set of zero-based (row, column) cells…

Checking your access…