Skip to content

Enter Factorial logic #6554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions dynamic_programming/factorial.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
#Factorial is the product of all positive integers less than or equal to a given positive integer
#and denoted by that integer and an exclamation point.
#For example, factorial seven is written 7!, meaning 1 × 2 × 3 × 4 × 5 × 6 × 7.
#Factorial zero is defined as equal to 1.

# Factorial of a number using memoization
#If n = 0, return 1
#Otherwise if n is in the memo, return the memo's value for n
#Otherwise,
#Calculate (n - 1)! x n
#Store result in the memo
#Return result


from functools import lru_cache

Expand Down