You are viewing a single comment's thread. Return to all comments →
Kotlin 100% - Use long for the last testcase.
private fun sumOfSquares(input: Long, sum: Long): Long{ return if(input == 0L) sum else sumOfSquares(input - 1, sum+(input*input)) } private fun sumOfNumbers(input: Long):Long{ return (input * (input+1))/2 }
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #6: Sum square difference
You are viewing a single comment's thread. Return to all comments →
Kotlin 100% - Use long for the last testcase.