From 291ff73102796a84faf43113d0b97ecd4016cbf0 Mon Sep 17 00:00:00 2001 From: David Kun Date: Wed, 14 Aug 2024 10:12:10 -0400 Subject: [PATCH] Add q47 --- src/ex/q047.clj | 5 +++++ test/ex/q047_test.clj | 12 ++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 src/ex/q047.clj create mode 100644 test/ex/q047_test.clj diff --git a/src/ex/q047.clj b/src/ex/q047.clj new file mode 100644 index 0000000..1013c34 --- /dev/null +++ b/src/ex/q047.clj @@ -0,0 +1,5 @@ +;; https://4clojure.oxal.org/#/problem/047 + +(ns ex.q047) + +(defn ans "Problem 47, Contain Yourself" [] 4) \ No newline at end of file diff --git a/test/ex/q047_test.clj b/test/ex/q047_test.clj new file mode 100644 index 0000000..4b8fc53 --- /dev/null +++ b/test/ex/q047_test.clj @@ -0,0 +1,12 @@ +;; https://4clojure.oxal.org/#/problem/047 + +(ns ex.q047-test + (:require [clojure.test :as t] + [ex.q047 :as sut])) + +(t/deftest test-q47 + (t/testing "Problem 47, Contain Yourself" + (t/is (contains? #{4 5 6} (sut/ans))) + (t/is (contains? [1 1 1 1 1] (sut/ans))) + (t/is (contains? {4 :a 2 :b} (sut/ans))) + (t/is (not (contains? [1 2 4] (sut/ans)))))) \ No newline at end of file