Ad
Code
Diff
  • package kata
    
    func Multiple3And5(number int) int {
    	sum := 0
    	for i := 3; i < number; i++ {
    		if i%15 == 0 {
    			sum += i
    			continue
    		}
    		if i%3 == 0 {
    			sum += i
    		}
    		if i%5 == 0 {
    			sum += i
    		}
    	}
    	return sum
    }
    • package kata
    • func Multiple3And5(number int) int {
    • sum := 0
    • for i := 3; i < number; i++ {
    • if i%15 == 0 {
    • sum += i
    • continue
    • }
    • if i%3 == 0 {
    • sum += i
    • }
    • if i%5 == 0 {
    • sum += i
    • }
    • }
    • return sum
    • }