Strong Numbers are the numbers whose sum of factorial of digits is equal to the original number. Given a number N, the task is to check if it is a Strong Number or not. Print 1 if the Number is Strong, else Print 0.
Input:N = 145Output:1Explanation:1! + 4! + 5! = 145 So, 145 is a Strong
Number and therefore the Output 1.
Input:N = 14Output:0Explanation:1! + 4! = 25 So, 14 isn't a Strong
Number and therefore the Output "NO".
You don't need to read input or print anything. Your task is to complete the function isStrong() which takes an Integer N as input and returns the answer.
Expected Time Complexity: O(|N|) Expected Auxiliary Space: O(1)