From: Robert Klemme Date: 2013-02-27T07:10:20+09:00 Subject: Re: Please, help (GCD) greatest common divisor. On Tue, Feb 26, 2013 at 9:39 PM, Henry Maddocks wrote: > > On 27/02/2013, at 7:48 AM, Bartosz DziewoƄski wrote: > >> Best I could do on short notice: >> >> gcd=->(_){_.sort_by(&:-@).inject{|p,q|q.nonzero?&&gcd[[q,p-q]]||--p}} >> $/=' ';gets;puts gcd[[$_,gets].map &(method :Integer)] > > LOL Yes, it's beatiful! Thank you Bartosz! Even the most obvious spoonfeeding thread can turn into beauty and art. Isn't that amazing? Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/