Created
January 3, 2013 17:14
-
-
Save plaster/4445043 to your computer and use it in GitHub Desktop.
This file contains 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
(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