![]() |
Given a number N, the task is to find the minimum number X such that A(X) = N, where A(X) for positive integer X is the sum of factorials of its digits. For example, A(154) = 1! + 5! + 4!= 145. Return a list of digits which represent the number X. Example:
Approach: To solve the problem follow the below idea:
Follow the steps to solve this problem:
Below is the implementation of this approach: C++
Java
Python3
C#
Javascript
Output
18 Time Complexity: O(log(N)) |
Reffered: https://www.geeksforgeeks.org
DSA |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 12 |