You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem Link: https://practice.geeksforgeeks.org/problems/perfect-numbers3207/1
Problem Statement: Given a number N, check if a number is perfect or not. A number is said to be perfect if sum of all its factors excluding the number itself is equal to the number.
Return 1 if the number is Perfect otherwise return 0.
Solution Approach:
Check the numbers from 2 to sqrt(n), and keep adding the numbers which divide n, and also add its divisor as well,
only check if the divisor and number is same for any number.