← Questions
Longest safe straight move for a robot between lasers
0
I was asked this
No reports yet. Sign in to say where you were asked it.
A board has some lasers, each at a cell; a laser destroys every cell in its row and its column. A robot stands on a given cell, which is safe even if a beam crosses it. It picks one of the four directions and moves straight until the board edge or until the next cell is destroyed. Return the most cells it can move in the best direction. Store the laser rows and columns in sets and walk each direction.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding
