Problem 1222 · Medium

Queens That Can Attack the King

On an eight-by-eight board, list every queen that has a clear line of attack to the king. The visual sends a ray from the king in each of eight directions and stops it at the first queen it meets.

Open the interactive visualisation