Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Sum of Pairs: Scala solutions by Julian Exenberger

  • Loading branch information...
commit 81c6ce4750fe3f558d00a32afc50e04dae2a8194 1 parent a1bdb58
@apauley authored
View
6 CodeSnippets/SumPairs/sumpairs-flatmap.scala
@@ -1,5 +1,7 @@
-// Scala solution by Julian Exenberger
-// http://dotneverland.blogspot.com/2009/09/quick-sample-of-lists-and-tuples-in.html
+/**
+Scala solution by Julian Exenberger
+http://dotneverland.blogspot.com/2009/09/quick-sample-of-lists-and-tuples-in.html
+*/
val numbers = List(1,2,3,4,5);
numbers.zip(numbers.tail).flatMap {
View
6 CodeSnippets/SumPairs/sumpairs-zipfold.scala
@@ -1,5 +1,7 @@
-// Scala solution by Julian Exenberger
-// http://dotneverland.blogspot.com/2009/09/quick-sample-of-lists-and-tuples-in.html
+/**
+Scala solution by Julian Exenberger
+http://dotneverland.blogspot.com/2009/09/quick-sample-of-lists-and-tuples-in.html
+*/
object SumPairs extends Application {
Please sign in to comment.
Something went wrong with that request. Please try again.