Re: Couldn't you explain me how does this little code work?
Posted 28 March 2012 - 01:54 AM
Basically, it works by converting a range of integers into an array, then a string. Then, using inject, it goes through and reduces the string by summing up all the integers two at a time. The Ruby documentation could definitely give you some better in-depth information about what exactly is happening. This code can be simplified and looks like it was purposely made to be over-complicated.