Skip to content

Instantly share code, notes, and snippets.

@goral09
Created July 22, 2015 19:04
Show Gist options
  • Save goral09/07cb151497ec15bac8c5 to your computer and use it in GitHub Desktop.
Save goral09/07cb151497ec15bac8c5 to your computer and use it in GitHub Desktop.
clojure version
(defn hiddenMsg [size seq]
(frequencies (map #(apply str %) (partition size 1 seq)))
)
(hiddenMsg 2 "ATAATGATATTAGAGACAAT")
;{"AA" 2, "TT" 1, "AC" 1, "AG" 2, "TA" 3, "AT" 5, "TG" 1, "GA" 3, "CA" 1}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment