src/rosalind/p005.clj @ 7f4e6345e260

Do the first few problems.
author Steve Losh <steve@stevelosh.com>
date Mon, 12 Nov 2012 12:36:49 -0500
parents (none)
children (none)
(ns rosalind.p005
  (:require [clojure.string :refer [split-lines trim]]))

(defn hamming [s t]
  (count (filter identity (map not= s t))))

(def sample
"GAGCCTACTAACGGGAT
CATCGTAATGACGGCCT")

(defn solve [s]
  (println (apply hamming
                  (-> s trim split-lines))))

(solve sample)

(print (solve (slurp "/Users/sjl/Downloads/rosalind_hamm.txt")))