You are given an n*n chess board with n queens. You need to find all the configurations of the pieces such that no two queens attack each other.
Each valid configuration is a unique list of n strings of length n where ‘Q’ and ‘.’ represents a Queen and empty space respectively.
Input: n = 4
Output: [["..Q.","Q...","...Q",".Q.."], [".Q..","...Q","Q...","..Q."]]
The first line contains an integer ‘T’, denoting the number of test cases.
For each test case, a line containing an integer ‘n’ denoting the dimension of the chess board and the number of queens.
For each test case, print all the valid configurations with each row on a separate line.
2
1
4
Q
..Q.
Q...
...Q
.Q..
.Q..
...Q
Q...
..Q.
1 <= T < 10
1 <= n < 10