Robert Klemme wrote:

> Also (as optimization) you could use "state << item" instead of "state + 
> [item]" because Array#<< returns self.  This saves you a lot temporary 
> 1element arrays and avoids creating new arrays all the time (Array#+ 
> creates a new Array). :-)

I dislike having the block of .inject having side effects. That sort of 
defeats the purpose IMHO.