Created
October 19, 2017 10:27
-
-
Save jaimeagudo/9ff9ec47623ecfb2aa467597a547d1cb to your computer and use it in GitHub Desktop.
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
;http://www.4clojure.com/problem/39#prob-title | |
(= (#(let [result (zipmap % %2)] | |
(apply concat result)) [1 2 3] [:a :b :c]) | |
'(1 :a 2 :b 3 :c)) | |
(= (#(let [result (zipmap % %2)] | |
(apply concat result)) [1 2] [3 4 5 6]) | |
'(1 3 2 4)) | |
(= (#(let [result (zipmap % %2)] | |
(apply concat result)) [1 2 3 4] [5]) | |
[1 5]) | |
(= (#(let [result (zipmap % %2)] | |
(apply concat result)) [30 20] [25 15]) | |
[30 25 20 15]) | |
; Solution | |
#(let [result (zipmap % %2)] | |
(apply concat result)) | |
;compact version #(apply concat (zipmap % %2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment