Created
April 25, 2013 19:36
-
-
Save chrisledet/5462498 to your computer and use it in GitHub Desktop.
Sums up all elements in list
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
| (defn summer | |
| [nums] | |
| (if (= (count nums) 1) | |
| (peek nums) | |
| (+ (summer (pop nums)) (peek nums)) | |
| ) | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment