From: Dennis Ranke Date: 2004-11-15T04:08:22+09:00 Subject: Re: [QUIZ] Countdown (#7) [Solution] Brian Schr�der wrote: > Hello Group, > > This was quite an interesting quiz. I tried different solutions of varying > complexity, but it turned out that the simplest approach worked best. That's a nice solution, but reading through the code I have one question regarding the memoized version: > def Integral.each_term_over(source, memo = {}, &block) > return memo[source] if memo[source] Shouldn't each_term_over call the block for each term when the terms for this set of sources was already generated before as well? Now it just returns the terms but each_term_over itself just ignore the return value. But maybe I just didn't understand the code correctly, after all, it appears to work well (although using too much memory on my machine ;)