Count Divisors

EasyMath

Description

Given a positive integer n, return the count of its positive divisors (including 1 and n itself).

Examples

Input:n = 12
Output:6
Explanation:

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

Input:n = 1
Output:1
Explanation:

Only 1 divides 1.

Input:n = 36
Output:9
Explanation:

36 = 2^2 * 3^2, so (2+1)(2+1) = 9 divisors.

Constraints

  • 1 ≤ n ≤ 10⁹

Ready to solve this problem?

Practice solo and sharpen your skills for technical interviews.