Implement a function to solve a specific logical puzzle, focusing on optimal time and space complexity.
Solve the N-Queens puzzle: place n queens on an n x n chessboard so that no two queens share a row, column, or diagonal. Return one valid placement as a list where the value at index r is the column chosen for row r; return [] if no solution exists.
Function signature: def solve_n_queens(n):
Constraints: 1 <= n <= 12. Any valid placement is accepted.
def solve_n_queens(n):