3848. Check Digitorial Permutation
You are given an integer
n.A number is called digitorial if the sum of the factorials of its digits is equal to the number itself.
Determine whether any permutation of
n(including the original order) forms a digitorial number.Return
trueif such a permutation exists, otherwise returnfalse.Note:
- The factorial of a non-negative integer
x, denoted asx!, is the product of all positive integers less than or equal tox, and0! = 1.- A permutation is a rearrangement of all the digits of a number that does not start with zero. Any arrangement starting with zero is invalid.
1 | class Solution { |