Check Perfect Number Problem

Check Perfect Number Problem — ExecCode Easy DSA Practice

Solve the Check Perfect Number problem on ExecCode. Free online easy DSA practice in Numbers & Math Logic. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Description You are given an integer n, return true if n is a perfect number, otherwise return false. Your task is to 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. Return the required answer exactly as shown in the examples.

Examples

Input {"n": 6}; Output Yes. Input {"n": 28}; Output Yes. Input {"n": 10}; Output No

Constraints

1 <= num <= 10^8

Practice Check Perfect Number free on ExecCode. Browse DSA problems, topic map, and placement guides.