1952. Three Divisors Easy
1/**
2 * [1952] Three Divisors
3 *
4 * Given an integer n, return true if n has exactly three positive divisors. Otherwise, return false.
5 * An integer m is a divisor of n if there exists an integer k such that n = k * m.
6 *
7 * Example 1:
8 *
9 * Input: n = 2
10 * Output: false
11 * Explantion: 2 has only two divisors: 1 and 2.
12 *
13 * Example 2:
14 *
15 * Input: n = 4
16 * Output: true
17 * Explantion: 4 has three divisors: 1, 2, and 4.
18 *
19 *
20 * Constraints:
21 *
22 * 1 <= n <= 10^4
23 *
24 */
25pub struct Solution {}
26
27// problem: https://leetcode.com/problems/three-divisors/
28// discuss: https://leetcode.com/problems/three-divisors/discuss/?currentPage=1&orderBy=most_votes&query=
29
30// submission codes start here
31
32impl Solution {
33 pub fn is_three(n: i32) -> bool {
34 false
35 }
36}
37
38// submission codes end
39
40#[cfg(test)]
41mod tests {
42 use super::*;
43
44 #[test]
45 fn test_1952() {
46 }
47}
48
Back
© 2025 bowen.ge All Rights Reserved.