Given the number 1024 right pad it to 6 characters
"1024 "
clojure (let [s (str 1024)
l (count s)]
(str s (reduce str (repeat (- 6 l) " "))))
(let [s (str 1024)
l (count s)]
(str s (reduce str (repeat (- 6 l) " "))))
Submit a new solution for
clojure
There are 31 other solutions in
additional languages (
cpp,
csharp,
erlang,
fantom ...)