easyEnumerationMathNumber Theory 0 views

Three Divisors

Given an integer n, return true if n has exactly three positive divisors.

Given an integer n, return true if n has exactly three positive divisors. Otherwise, return false.

An integer m is a divisor of n if there exists an integer k such that n = k * m.

Example 1

Input: n = 2

Output: false

Example 2

Input: n = 4

Output: true

Constraints

  • 1 <= n <= 10^4

Hints

Companies

No companies reported yet.

Discussion

Sign in to join the discussion.

Loading discussion...

Test results

No test cases yet.