Advertisement
Average-user

Clojure/nqueens

Nov 30th, 2017
1,292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defn queens [n]
  2.   (filter (fn [p] (every? #(apply distinct? (map-indexed % p)) [+ -]))
  3.           (combo/permutations (range 1 (inc n)))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement