exercism / clojure

Exercism exercises in Clojure.

Home Page:https://exercism.org/tracks/clojure

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Nucleotide Count" -- Tests Pass Locally but not on Exercism Website

SSShupe opened this issue · comments

My solution passes all the tests locally but fails the three "count-of-nucleotide-in-strand" test in the on-line test suite. Relevant code is below.

(defn count-of-nucleotide-in-strand [ch s]
  (if (not (.contains [\A \G \C \T] ch))
    (throw (Exception. "Not a nucleotide"))
    (count (filter #(= ch %) s))))

The online test runner uses the Small Clojure Interpreter, see https://github.com/babashka/babashka#differences-with-clojure

Thanks, that must mean the ".contains" function from Java isn't available. I changed my code accordingly and now it passes the tests. You might want to note the use of the Small Clojure Interpreter somewhere in the Clojure track instructions if it's not already there.