Practice Perfect Number
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
A perfect number is a positive integer that is equal to the sum of its positive divisors, excluding the number itself. A divisor of an integer x is an integer that can divide x evenly. Given an integer n, return true if n is a perfect number, otherwise return false.
Source: Perfect Number on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
Input
num = 28
Output
true
# Example 2
Input
num = 7
Output
false
Constraints
1 <= num <= 10^8
Related LeetCode Problems
Practice more problems similar to Perfect Number.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.