Jump to content

Solve hanging lantern problem: Difference between revisions

m
Line 1,393:
===Directly computing the count===
 
If computeCompute the count directly:
<syntaxhighlight lang="ruby" line>Factorial = Hash.new{|h, k| h[k] = k * h[k-1] } # a memoized factorial
Factorial[0] = 1
1,149

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.