Agreed, I'm not a huge fan of the solution. John and Robert's are much more straightforward, reusable, and elegant.

You shouldn't have to use a variable called temp_array ... almost ever.
On Sunday, 15 May 2011 at 4:01 pm, 7stud -- wrote:
Thomas Greenwood wrote in post #998795:
> > 
> > A kludge but it does the job.
> 
> After asking for advice on a computer programming forum, the chosen 
> solution should never be a kludge. Rather, the solution should be 
> elegant and inspiring, and you should learn somethin.
> 
> -- 
> Posted via http://www.ruby-forum.com/.
>