From: tamouse mailing lists Date: 2013-02-27T13:47:38+09:00 Subject: Re: Please, help (GCD) greatest common divisor. 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)] > > -- > Matma Rex > OMG this is gorgeous.