N-queens backtracking problem