June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
6
Task/N-queens-problem/Clojure/n-queens-problem-2.clj
Normal file
6
Task/N-queens-problem/Clojure/n-queens-problem-2.clj
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
(ns queens
|
||||
(:require [clojure.math.combinatorics :as combo]
|
||||
|
||||
(defn queens [n]
|
||||
(filter (fn [x] (every? #(apply distinct? (map-indexed % x)) [+ -]))
|
||||
(combo/permutations (range 1 (inc n)))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue