Factorial of a number
Sun Feb 06 2022 02:48:25 GMT+0000 (Coordinated Universal Time)
Saved by @Uttam #java #mathematics #lecture #gfg #geeksforgeeks #factorial #iterative #recursive
Factorial Of Number Given a positive integer N. The task is to find factorial of N. Example 1: Input: N = 4 Output: 24 Explanation: 4! = 4 * 3 * 2 * 1 = 24 Example 2: Input: N = 13 Output: 6227020800 Explanation: 13! = 13 * 12 * .. * 1 = 6227020800 Your Task: You don't need to read input or print anything. Your task is to complete the function factorial() that takes N as parameter and returns factorial of N. Expected Time Complexity: O(N) Expected Auxilliary Space: O(1) Constraints: 0 <= N <= 18
https://practice.geeksforgeeks.org/tracks/DSASP-Mathematics/?batchId=190&tab=2
Comments