Hard level Data Structure question related to back-tracking.
Implement solve_n_queens(n) using backtracking. Return every distinct placement of n queens on an n x n chessboard so that no two queens share a row, column, or diagonal. Represent each board as a list of strings using Q for a queen and . for an empty square. Return an empty list when no placement exists.
Q and . in the board representationdef solve_n_queens(n):