Created
October 27, 2013 17:01
-
-
Save johnwalker/7185015 to your computer and use it in GitHub Desktop.
Incomplete
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns ieee2013.binpalindromes) | |
(defn log2up [x] | |
(int (Math/ceil (/ (Math/log x) | |
(Math/log 2) | |
2)))) | |
(defn problem [] | |
(let [[lower upper] | |
(mapv #(. Integer parseInt %) | |
(clojure.string/split (read-line) #","))] | |
(println (apply - (map #(Math/pow % 0.5) [upper lower]))))) | |
(problem) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment