Skip to content

Instantly share code, notes, and snippets.

@plaster
Created January 3, 2013 17:14
Show Gist options
  • Save plaster/4445043 to your computer and use it in GitHub Desktop.
Save plaster/4445043 to your computer and use it in GitHub Desktop.
(def solve
(memoize
(fn [w h]
(if (or (zero? w)
(zero? h))
1
(+ (solve (dec w) h)
(solve w (dec h)))
))))
(defn -main
[& args]
(println (solve 20 20)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment