Last active
December 18, 2015 11:49
-
-
Save mbc9news/5778401 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
object Euler_010 extends App { | |
def sumPrimeList(pList:List[Int], pSum:Long = 0):Long = { | |
// println(pList.length) | |
if(pList.length equals 0) return pSum | |
sumPrimeList(pList.filterNot(n => n%pList.head equals 0), pSum+pList.head) | |
} | |
sumPrimeList((2 to 10).toList) | |
sumPrimeList((2 to 2000000).toList) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment