We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
#!/bin/python3importmathimportosimportrandomimportreimportsys# Complete the extraLongFactorials function below.defextraLongFactorials(n):cache={}defrec(n):ifnincache:returncache[n]ifn==1:return1result=n*rec(n-1)cache[n]=resultreturnresultreturnrec(n)if__name__=='__main__':n=int(input())print(extraLongFactorials(n))
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Extra Long Factorials
You are viewing a single comment's thread. Return to all comments →