code: def n_queens(queen_count):
      
      out =list()
      cols = range(queen_count)
      #for vec in permutations(cols):
      for vec in permutations(cols,None):
          if (queen_count == len(set(vec[i]+i for i in cols))
                          == len(set(vec[i]-i for i in cols))):
              #yield vec
              out.append(vec)
      return out
docs: N-Queens solver.
  
      Args:
          queen_count: the number of queens to solve for. This is also the
              board size.
  
      Yields:
          Solutions to the problem. Each yielded value is looks like
          (3, 8, 2, 1, 4, ..., 6) where each number is the column position for the
          queen, and the index into the tuple indicates the row.