[ prog / sol / mona ]

prog


[challenge] Inverse Factorial

12 2021-06-06 22:13

Remember that

n! = 1 * 2 * ... * (n - 2) * (n - 1) * n

Then starting with 2 one should go up until m is factored, otherwise it's not a factorial.
This method is O(n) or O(sqrt(m)), but I'm not sure if there are better way to do this.

22


VIP:

do not edit these