Created
November 13, 2011 16:41
-
-
Save pyykkis/1362307 to your computer and use it in GitHub Desktop.
Clojure implementation for KataPotter
This file contains hidden or 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
(def book-price 8) | |
(def discounts [1 1 0.95 0.90 0.80 0.75]) | |
(defn price [books] | |
(let [uniques (set books) | |
discount (discounts (count uniques))] | |
(+ (* (count uniques) book-price discount))) (price (remove books uniques))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment