Skip to content
Browse files

Sum of Pairs: some comments/credits

  • Loading branch information...
1 parent 8552fad commit 136a21b0d26e02efe5c0a75131f1d07f06b4883e @apauley committed
Showing with 3 additions and 2 deletions.
  1. +2 −2 Snippets/SumPairs/sumpairs-map.py
  2. +1 −0 Snippets/SumPairs/sumpairs.clj
View
4 Snippets/SumPairs/sumpairs-map.py
@@ -1,5 +1,5 @@
-from operator import add
-
# Solution by Pieter Nagel, based on the Clojure solution
+
+from operator import add
a = [1, 2, 3, 4, 5]
map(add, a[1:], a[:-1])
View
1 Snippets/SumPairs/sumpairs.clj
@@ -1,4 +1,5 @@
; Solution by Timothy Pratley
; http://groups.google.com/group/clojure/browse_thread/thread/ca3ad049fba7ee82
+
(def a '(1 2 3 4 5))
(map + a (rest a))

0 comments on commit 136a21b

Please sign in to comment.
Something went wrong with that request. Please try again.