Created
February 10, 2015 03:52
-
-
Save timbogit/b41e92092620f6d927dc to your computer and use it in GitHub Desktop.
Solution to Problem 73
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#(first (reduce-kv | |
(fn [res k v] | |
(if (or | |
(clojure.set/subset? #{0 1 2} v) | |
(clojure.set/subset? #{3 4 5} v) | |
(clojure.set/subset? #{6 7 8} v) | |
(clojure.set/subset? #{0 3 6} v) | |
(clojure.set/subset? #{1 4 7} v) | |
(clojure.set/subset? #{2 5 8} v) | |
(clojure.set/subset? #{0 4 8} v) | |
(clojure.set/subset? #{2 4 6} v)) | |
(conj res k) | |
res)) | |
'() | |
(reduce-kv | |
(fn [m k v] | |
(assoc m k (set (map first v)))) | |
{} | |
(dissoc (group-by second (map-indexed list (flatten %))) :e)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment