Skip to content

Instantly share code, notes, and snippets.

@marchdown
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marchdown/d1388e064570439a39fb to your computer and use it in GitHub Desktop.
Save marchdown/d1388e064570439a39fb to your computer and use it in GitHub Desktop.
; Read a number from STDIN
; Read that many lines of input from STDIN. Print output to STDOUT
(defn shashank [s]
(- (count s) (count (partition-by identity s))))
(defn -main []
(println "give me a number of lines followed by that
many lines")
(loop [t (Integer/parseInt (read-line))]
(when (pos? t)
(println (str (shashank (read-line))))
(recur (dec t)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment