From: c p r a s l e y at h o m e dot c o m (Chris) Date: 2002-01-27T15:13:51+09:00 Subject: Re: Coding challenge :-) On Sun, 20 Jan 2002 13:50:45 GMT, David Alan Black wrote in comp.lang.ruby: >allowing for out-of-order numbers (which have to be put in >order), negative numbers, mixed input ("1,8,5,-3,10,-2,3-4", >which should come out as both "-3--2,1,3-5,8,10" and >"-3,-2,1,3,4,5,8,10"), etc. "-3--2" is ugly. You should use a different range indicator such as "-3/-2,1,3/5,8,10" or a more Ruby-like "-3..-2,1,3..5,8,10". Ranges of two units are no more efficiently stated as a range than they would be as a list of two items, so the ideal result would probably be "-3,-2,1,3..5,8,10".