  Showing: Handle Score
@Ibrahim Nash 5761
@akhayrutdinov 5111
@mb1973 4989
@Quandray 4944
@saiujwal13083 4506
@sanjay05 3762
@marius_valentin_dragoi 3516
@sushant_a 3459
@verma_ji 3341
@KshamaGupta 3318
Smith Number
Medium Accuracy: 16.67% Submissions: 18 Points: 4

Given a number n, the task is to find out whether this number is smith or not. A Smith Number is a composite number whose sum of digits is equal to the sum of digits in its prime factorization.

Example 1:

Input:
n = 4
Output:
1
Explanation:
Prime factorization = 2, 2; and 2 + 2 = 4
Therefore, 4 is a smith number.


Example 2:

Input:
n = 6
Output:
0
Explanation:
Prime factorization = 2, 3; and 2 + 3 is
not 6. Therefore, 6 is a smith number.

You don't need to read input or print anything. Your task is to complete the function smithNum() which takes an Integer n as input and returns the answer.

Expected Time Complexity: O(n)
Expected Auxiliary Space: O(n)

Constraints:
1 <= n <= 105

### Editorial

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

#### My Submissions:  