From 2982a36c67aa4eeeb805353eecdacde650f2ec5c Mon Sep 17 00:00:00 2001 From: David Kun Date: Sun, 15 Sep 2024 09:22:03 -0400 Subject: [PATCH] Add q71 --- src/ex/q071.clj | 12 ++++++++++++ test/ex/q071_test.clj | 9 +++++++++ 2 files changed, 21 insertions(+) create mode 100644 src/ex/q071.clj create mode 100644 test/ex/q071_test.clj diff --git a/src/ex/q071.clj b/src/ex/q071.clj new file mode 100644 index 0000000..73f5382 --- /dev/null +++ b/src/ex/q071.clj @@ -0,0 +1,12 @@ +;; https://4clojure.oxal.org/#/problem/071 + +(ns ex.q071) + +(defn ans + "Problem 71, Rearranging Code: ->" + [] + (-> [2 5 4 1 3 6] + reverse + rest + sort + last)) \ No newline at end of file diff --git a/test/ex/q071_test.clj b/test/ex/q071_test.clj new file mode 100644 index 0000000..0e25192 --- /dev/null +++ b/test/ex/q071_test.clj @@ -0,0 +1,9 @@ +;; https://4clojure.oxal.org/#/problem/071 + +(ns ex.q071-test + (:require [clojure.test :as t] + [ex.q071 :as sut])) + +(t/deftest test-q71 + (t/testing "Problem 71, Rearranging Code: ->" + (t/is (= (last (sort (rest (reverse [2 5 4 1 3 6])))) (sut/ans))))) \ No newline at end of file