We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Would this be possible using Clojure's loop-recur functions? I played with a bit and decided it couldn't be done, anbody have any insights on whether that is accurate?
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Fibonacci Numbers
You are viewing a single comment's thread. Return to all comments →
Some ugly Clojure:
(println ((fn fibs [num] (let [sum 0] (if (= 1 num) 0 (if (= 2 num) 1 (+ (fibs (dec num)) (fibs (- num 2))))))) (Integer/parseInt (clojure.string/trim (read-line)))))
Would this be possible using Clojure's loop-recur functions? I played with a bit and decided it couldn't be done, anbody have any insights on whether that is accurate?