2025-08-16 09:24:35 +0000 UTC

Three Divisors

Code

class Solution:
    def isThree(self, n: int) -> bool:
        count = 1
        for num in range(2, n // 2 + 1):
            if n % num == 0:
                count += 2
            if count > 3:
                break
        return count == 3