// def nQueens(n: Int): Iterator[Seq[Int]] = (0 until n).permutations.filter(_.zipWithIndex.flatMap{ (c, d) => Seq(n+c+d, c-d) }.toSet.size == 2*n)