#3848
Check Digitorial Permutation
specialist · 935 · lc medium +32 · 46.4% accepted · 56 likes · top 31%
Description
Given an integer n, a number is digitorial when the sum of the factorials of its individual digits equals the number itself. Determine whether any rearrangement of the digits of n (including the original order) produces a digitorial number. Return true if such a permutation exists, false otherwise. Recall that x! is the product of all positive integers up to x (with 0! = 1), and permutations that begin with a leading zero are invalid.
Code
1
2
3