Return the number of positive divisors of n (including 1 and n).
For n = 36 the answer is 9 (1, 2, 3, 4, 6, 9, 12, 18, 36).
The starter code tests every number up to n. It is correct but far too slow for large n.
Example 1
Input:
count_divisors(36)
Output:
9
Example 2
Input:
count_divisors(1)
Output:
1
1 <= n <= 10**12No results yet
Run your code to check it against the examples, or submit to run every test.