Skip to content

Commit

Permalink
Add q47
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkun committed Aug 14, 2024
1 parent ae16b7f commit 291ff73
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ex/q047.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
;; https://4clojure.oxal.org/#/problem/047

(ns ex.q047)

(defn ans "Problem 47, Contain Yourself" [] 4)
12 changes: 12 additions & 0 deletions test/ex/q047_test.clj
Original file line number Diff line number Diff line change
@@ -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))))))

0 comments on commit 291ff73

Please sign in to comment.