From: Robert Dober Date: 2008-11-08T03:14:35+09:00 Subject: Re: Finding gaps in a sorted sequence On Fri, Nov 7, 2008 at 9:28 AM, Brian Adkins wrote: > Martin DeMello writes: > I still think I like it best though because it seems to be the most > natural Ruby solution to the original problem. Well not quite, it does not return nil if there is no gap, one has to check if the return value is the last element of the array and replace it with nil in that case. One should know that inject is quite slow, but no reason not to use it unless performance is a problem. Cheers Robert -- C'est véritablement utile puisque c'est joli. Antoine de Saint Exupéry