Essential JavaScript

Picky Numbers Kata

Given a start and end number, along with a nope number, count up the value of all numbers between start and end (including both of them) that are not divisible by nope.

For example, if start is 1 and end is 10, we would begin with these numbers:

1 2 3 4 5 6 7 8 9 10

If nope is 3, we would remove all numbers divisible by 3 and be left with these numbers:

1 2 _ 4 5 _ 7 8 _ 10

The sum of the above numbers is 37, so that would be the correct answer.

Code Editor