re: Project Euler #1 - Multiples of 3 and 5 VIEW POST

FULL DISCUSSION
 

Scala:

def sumOfMultiples(max: Int): Int = {
    if (max <= 0) 0
    else if (max % 3 == 0 || max % 5 == 0) max + sumOfMultiples(max - 1)
    else sumOfMultiples(max - 1)
  }  
code of conduct - report abuse