Permalink
Browse files

Sum of Pairs: Comments

  • Loading branch information...
1 parent f674621 commit 75522b35218632ab69fd7d88210d5b81e0df3f74 Andreas Pauley committed Sep 17, 2009
@@ -1,7 +1,7 @@
-// Solution by Etienne Labuschagne
+// Java solution by Etienne Labuschagne
// Edited by me to fit in with the other examples
-public class SumOfNeighbours {
+public class SumOfPairs {
public static int[] sumPairs(int[] a) {
int[] newArray = new int[a.length-1];
@@ -1,4 +1,4 @@
-# Solution by Pieter Nagel, based on the Clojure solution
+# Python solution by Pieter Nagel, based on the Clojure solution
from operator import add
a = [1, 2, 3, 4, 5]
@@ -1,4 +1,4 @@
-# Solution by Dawie Strauss
+# Python solution by Dawie Strauss
a = [1, 2, 3, 4, 5]
[sum(i) for i in zip(a,a[1:])]
@@ -1,4 +1,4 @@
-; Solution by Timothy Pratley
+; Clojure solution by Timothy Pratley
; http://groups.google.com/group/clojure/browse_thread/thread/ca3ad049fba7ee82
(def a '(1 2 3 4 5))
@@ -1,4 +1,4 @@
-// Solution by Etienne Labuschagne
+// JavaFX solution by Etienne Labuschagne
var originalArray = [1,2,3,4,5];
for (i in for (e in [0..3]){originalArray[e]+originalArray[e+1]}){println(i)}

0 comments on commit 75522b3

Please sign in to comment.