5 XP challenge

Count Either Divisor

very easy
Build it yourself · 3 min
1 Learn2 Predict3 Solve

Task
Your mission

Count integers from 1 through limit divisible by firstDivisor or secondDivisor. limit is 0 to 30; both divisors are 1 to 10.

Examples

InputReturn
limit = 10, firstDivisor = 2, secondDivisor = 3

count: 0 → 1 → 2 → 3 → 4 → 5 → 6 → 7. The result is 7.

7
limit = 6, firstDivisor = 2, secondDivisor = 3

count: 0 → 1 → 2 → 3 → 4. The result is 4.

4

Your code

Write your answer inside Solution, then use return to send it back.

Try examples runs the public examples. Check my code checks your full answer and saves your completion.