Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- link:https://www.geeksforgeeks.org/factorial-large-number/
- class Solution:
- def factorial(self, N):
- #code here
- arr=[0]*500
- arr[0]=1
- global size
- size=1
- def mul(n):
- global size
- i,carry=0,0
- while carry!=0 or i<size:
- prod=arr[i]*n+carry if i<size else 0
- carry=prod//10
- arr[i]=prod%10
- i=i+1
- size=i
Add Comment
Please, Sign In to add comment