P15390 [GeeksforGeeks] Factorials of large numbers2508
普及
题目描述

Given an integer N, find its factorial. return a list of integers denoting the digits that make up the factorial of N.
Example 1:
Input: N = 5
Output: 120
Explanation : 5! = 12345 = 120
Example 2:
Input: N = 10
Output: 3628800
Explanation :
10! = 123456789*10 = 3628800
Your Task:
You don't need to read input or print anything. Complete the function factorial() that takes integer N as input parameter and returns a list of integers denoting the digits that make up the factorial of N.
Expected Time Complexity : O(N^{2})
Expected Auxilliary Space : O(1)
Constraints:
1 ≤ N ≤ 1000

输入格式

见题面

输出格式

见题面

样例输入
N = 5
样例输出
120