Think360.ai interview question

variation of N-Queens backtracking problem.