Hello World N Times
Hello World N Times
rorick + 0 comments Bad problem description for Clojure.
Description states to copy template and fill blank:
(fn[n]___________________________)
But prepared caller part of solution is
(hello_word_n_times n)
and is not editable. It will not compile if one copies template and fills blanks. Temlate must be(defn hello_word_n_times [n]___________________________)
or(def hello_word_n_times (fn[n]___________________________))
.BTW, there's also a misspelling in calling part that cannot be edited: word instead of wor**l**d.
I'm starting to suspect, that guys from Hackerrank do not really like Clojurists) Another surprise waiting Hackerrank student on his way of learning FP in Clojure is when his tested and submitted solution will fail with compile error. That's most likely because of version mismatch. Described environment is Clojure 1.9 and that is what anyone expects, but in reality it is ancient Clojure 1.6.
uvaprakashp + 0 comments Scala version
def f(n: Int) = println("Hello World\n" * n)
alsuga + 0 comments Lang: Haskell
I'm learning haskell, if someone have a suggestion or a correction please let me knowhello_worlds 1 = putStrLn "Hello World" hello_worlds n = do putStrLn "Hello World" hello_worlds (n - 1) main = do n <- readLn :: IO Int hello_worlds n
christopher_lil1 + 0 comments My version in Haskell:
hello_worlds n = mapM_ putStrLn $ replicate n "Hello World"
xiang19950505 + 0 comments My version in Haskell:
import Control.Monad (replicateM_) hello_worlds :: Int -> IO () hello_worlds n = replicateM_ n $ putStrLn "Hello World"
Sort 120 Discussions, By:
Please Login in order to post a comment