Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Complete the sockMerchant function below.
- (defn sockMerchant [n ar]
- (def totals (reduce #(assoc %1 %2 (inc (%1 %2 0))) {} ar))
- (reduce (fn [total socks] (+ total (int (/ (last socks) 2)))) 0 totals)
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement