From: Rob Biedenharn Date: 2009-10-01T05:44:48+09:00 Subject: Re: SystemStackError: stack level too deep > how make it deeper? On Sep 30, 2009, at 4:30 PM, Joshua Muheim wrote: > Jason Roelofs wrote: >> On Wed, Sep 30, 2009 at 3:47 PM, Joshua Muheim wrote: >> >>> end >>> (#{result_h})" >>> >>> >>> Thanks a lot for help >>> Josh >>> -- >>> Posted via http://www.ruby-forum.com/. >>> >>> >> Rewrite it to not be recursive. >> >> Jason > > That's not very helpful... Some sort of tautology, isn't it. ;-) > http://en.wikipedia.org/wiki/Tautology Or a problem from Project Euler... ;-) http://projecteuler.net/index.php?section=problems&id=45 real 0m0.639s user 0m0.623s sys 0m0.008s And my solution (in Ruby) could even be made more efficient. However, it uses a constant amount of space (i.e., no recursion at all, just some nested loops). -Rob Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com