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.
Why are u using extra space that is list and then calculating maximum of that. You can simply calculate the factorial by directly multiplying factorial variable with decreasing n
Here it is:
fact=1whilen>1:fact=fact*nn=n-1print(fact)
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 →
Why are u using extra space that is list and then calculating maximum of that. You can simply calculate the factorial by directly multiplying factorial variable with decreasing n Here it is: