Skip to content

Instantly share code, notes, and snippets.

@joladev
Last active August 29, 2015 14:02
Show Gist options
  • Save joladev/fdbfc6ea8a82a81ba6bb to your computer and use it in GitHub Desktop.
Save joladev/fdbfc6ea8a82a81ba6bb to your computer and use it in GitHub Desktop.
(def combinations
(for [x (range 1 98) y (range 1 98)
:when (>= 98 (+ x y))]
(let [z (- 100 x y)]
{:x x :y y :z z})))
(defn winner? [{:keys [x y z]}]
(== 100 (+ (* 15 x) (* 1 y) (* 0.25 z))))
(defn find-winner []
(filter winner? combinations))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment