Advertisement
Guest User

Untitled

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