From: "Gulyás Attila" Date: 2013-02-27T23:39:39+09:00 Subject: Re: Please, help (GCD) greatest common divisor. Hello Everyone, This thread is the best example why it is worth reading every single mail in this list and I would like to thank Bartosz for his solution. I didn't understand it at first so I came up with a little explanation for the constructs used in it: https://gist.github.com/toraritte/5048189 Would you mind looking into this gist whether I am on the right path? Thanks for your time. regards Attila On Wed, Feb 27, 2013 at 5:47 AM, tamouse mailing lists wrote: > On Tue, Feb 26, 2013 at 12:48 PM, 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)]