• + 0 comments

    Never posted one of these so sorry if the formatting isn't right but I didn't see a clojure solution yet so here is mine below.(def my_func (memoize (fn [n] (condp = n 0 0 1 1 2 1 (mod (+ (my_func (dec n)) (my_func (- n 2))) 100000007))))) (def a (Integer/parseInt (read-line))) (doseq [a-itr (range a)] (println (my_func (Integer/parseInt (read-line)))) )