Solve the N-Queens problem, explaining your backtracking strategy and how you would optimize the state representation.
Implement solve_n_queens(n), which returns every valid arrangement of n queens on an n x n board. Represent each board as a list of n strings, using Q for a queen and . for an empty square. Return an empty list when no arrangement exists. The function should avoid placing queens that share a column or diagonal.
def solve_n_queens(n):