FunctionRacerProblemsRace

Count Divisors

BeginnerMathPython, JavaScript, TypeScript, Java, C++

Return how many positive integers divide n evenly, counting both 1 and n itself.

Example 1

n 12
returns 6

1, 2, 3, 4, 6, 12.

Example 2

n 13
returns 2

1 and 13.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Math problems