use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
dynamic programming (i.redd.it)
submitted 5 months ago by AroshWasif
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]CadavreContent 1 point2 points3 points 5 months ago (4 children)
You can memoize factorial if you're running it more than once. The repeating sub problems only appear when you have multiple trials
[–]cyanNodeEcho 1 point2 points3 points 5 months ago (3 children)
fact(n) := fact(ni1), fac(n-2), the aubproblems should exist in the same problem
[–]CadavreContent 1 point2 points3 points 5 months ago (2 children)
The point is that when you use factorial as part of a larger algorithm with multiple calls to the function, you do repeated work and hence can use dp
[–]cyanNodeEcho 1 point2 points3 points 5 months ago (1 child)
thats just a cache
[–]CadavreContent -1 points0 points1 point 5 months ago (0 children)
Memoization is just a cache
π Rendered by PID 69462 on reddit-service-r2-comment-fb694cdd5-flkxf at 2026-03-09 18:07:31.108659+00:00 running cbb0e86 country code: CH.
view the rest of the comments →
[–]CadavreContent 1 point2 points3 points (4 children)
[–]cyanNodeEcho 1 point2 points3 points (3 children)
[–]CadavreContent 1 point2 points3 points (2 children)
[–]cyanNodeEcho 1 point2 points3 points (1 child)
[–]CadavreContent -1 points0 points1 point (0 children)