Mark a Queen’s Attack Board
Problem statement
Given a square board size and a zero-based queen position, return the board as strings. Use Q for the queen, X for every other cell in the queen’s row, column, or diagonals, and . for an unattacked cell.
Function
markQueenAttacks(size: int, queenRow: int, queenCol: int) → String[]Examples
Example 1
size = 4queenRow = 0queenCol = 0return = ["QXXX","XX..","X.X.","X..X"]Example 2
size = 3queenRow = 1queenCol = 1return = ["XXX","XQX","XXX"]Constraints
1 <= size <= 200.0 <= queenRow, queenCol < size.