From: Tom Sawyer Date: 2002-08-06T20:57:24+09:00 Subject: Re: Coding challenge (on Ruby Garden) damn! i went to measure the speed on that one liner, but alas i run on stable. what's inject do? also, it would be nice to have a brief description of the main idea behind the solution. (all of the solutions, actually) ~transami On Tue, 2002-08-06 at 05:41, George Ogata wrote: > David Alan Black wrote: > > > Hi -- > > > > On Tue, 6 Aug 2002, Avi Bryant wrote: > > > >> David Alan Black wrote in message > >> news:... > >> > Hello -- > >> > > >> > Coding Challenge 0002 (my numbering scheme :-) has been posted to > >> > . > >> > >> So, what are the criteria for the challenge, apart from passing the > >> tests? This obviously isn't golf, but the stats for my solution are: > >> > >> bytes: 139 > >> lines: 3 > >> expressions: 1 > >> assignments: 0 > > > > The criteria are passing the tests, and the mysterious "meeting the > > requirements" (which is a way of saying I doubt that the tests are > > comprehensive enough). I think you get the honorary golf trophy, > > though :-) > > > > > > David > > > > I think Avi's doesn't quite meet the requirements. This should be true, > shouldn't it?: > > one_in_each([1,2,3],[[1,2],[1,2],[1,3]]) > > I have a 118 char solution (including the "def..end"!) which I think meets > all requirements. Anyone care to shorten it? > > http://www.rubygarden.org/ruby?G00002 > -- ~transami