Perfect Number
A perfect number is a positive integer that equals the sum of its divisors that are smaller than itself. For instance 6 = 1 + 2 + 3.
Return True if num is perfect and False otherwise.
Example 1
num 28
returns true
1 + 2 + 4 + 7 + 14 = 28.
Example 2
num 12
returns false
1 + 2 + 3 + 4 + 6 = 16.
Constraints
1 <= num <= 10000
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.