You are viewing a single comment's thread. Return to all comments →
Clojure
(use '[clojure.string :only (split)]) (let [[n k] (split (read-line) #" ") k (Integer/parseInt k)] (->> n (map #(- (int %) (int \0))) (reduce + 0) (* k) (#(rem % 9)) (#(if (zero? %) 9 %)) println))
Seems like cookies are disabled on this browser, please enable them to open this website
Super Digit
You are viewing a single comment's thread. Return to all comments →
Clojure