Incorrect test case result, off by 1?

Tell us what’s happening:
I believe the test case for 1000 is incorrect. The system won’t accept my solution that results in a value of “234168”, whereas it wants “233168”.

Your code so far


function multiplesOf3and5(number) {
// Good luck!
let result = 0;
for(let i = 3; i <= number; i++){
  if(i % 3 == 0 || i % 5 == 0){
    result += i;
  }
}
return result;
}

multiplesOf3and5(1000);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36.

Challenge: Problem 1: Multiples of 3 and 5

Link to the challenge:

The instructions state:

Find the sum of all the multiples of 3 or 5 below the provided parameter value number .

The key word here is below.

2 Likes

I understand, thank you. Off by 1 indeed.