Leaderboard
Showing:
Handle Score
@Ibrahim Nash 6420
@blackshadows 6380
@mb1973 5642
@Quandray 5233
@akhayrutdinov 5111
@saiujwal13083 4610
@sanjay05 3762
@kirtidee18 3673
@marius_valentin_dragoi 3522
@sushant_a 3459
@verma_ji 3413
Complete Leaderboard
Strong Numbers
Basic Accuracy: 67.83% Submissions: 797 Points: 1

Strong Numbers are the numbers whose sum of factorial of digits is equal to the original number. Given a number, the task is to check if it is a Strong Number or not.
 

Example 1:

Input: 145
Output: 1
Explanation: 1! + 4! + 5! = 145

Example 2:

Input: 5314
Output: 0
Explanation: 5! + 3! + 1! + 4! 
is not equal to 5314.

 

Your Task:
You don't need to read or print anything. Your task is to complete the function is_StrongNumber() which takes the number as input parameter and returns 1 if it is Strong Number otherwise returns 0.

 

Expected Time Complexity : O(Number of digits in N)
Expected Space Complexity: O(1)

 

Constraints:
1 <= n <= 10000

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.

Strong Numbers

Output Window