Rooks LUNCHTIME

Can someone suggest algorithm for ROOKS?

The maximum no of rooks that can be placed will be equal to the dimension of the board (equals n).
The intuition of above is that- "you can place a rook on any cell (ie, row R and column C), then you are using the row and column once and once a row or column is used once, it can’t be used again). So, for every empty row, you always have an option to assign any column which is not used before.

My solution link: Rooks AC solution