We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 633e722 commit 906c84aCopy full SHA for 906c84a
src/ex/q061.clj
@@ -0,0 +1,8 @@
1
+;; https://4clojure.oxal.org/#/problem/061
2
+
3
+(ns ex.q061)
4
5
+(defn ans
6
+ "Problem 61, Map Construction. restriction: zipmap"
7
+ [k v]
8
+ (into {} (map #(vector %1 %2) k v)))
test/ex/q061_test.clj
@@ -0,0 +1,11 @@
+(ns ex.q061-test
+ (:require [clojure.test :as t]
+ [ex.q061 :as sut]))
+(t/deftest test-q61
+ (t/testing "Problem 61, Map Construction"
9
+ (t/is (= {:a 1, :b 2, :c 3} (sut/ans [:a :b :c] [1 2 3])))
10
+ (t/is (= {1 "one", 2 "two", 3 "three"} (sut/ans [1 2 3 4] ["one" "two" "three"])))
11
+ (t/is (= {:foo "foo", :bar "bar"} (sut/ans [:foo :bar] ["foo" "bar" "baz"])))))
0 commit comments