Last active
August 29, 2015 14:03
-
-
Save skuro/a673f7d687998d1b21d7 to your computer and use it in GitHub Desktop.
Solution for the problems in today's meetup
This file contains hidden or 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
| ; https://www.hackerrank.com/challenges/functional-programming-warmups-in-recursion---fibonacci-numbers | |
| (let [fibos (iterate (fn [[a0 a1]] [a1 (+ a0 a1)]) [0 1]) | |
| fibo (fn [n] (->> n dec (nth fibos) first))] | |
| (-> | |
| (read) | |
| fibo | |
| println)) | |
| ;https://www.hackerrank.com/challenges/pascals-triangle | |
| (let [k (read) | |
| funny (fn [v] | |
| (apply println v) | |
| (map + (concat [0] v) (concat v [0]))) | |
| _ (nth (iterate funny [1]) k)]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment