Code Golf: Choose

JAN

16

2008

Here is my submission for the Choose challenge. Code size: 88 bytes.

def g(r)(1..r).inject(1){|m,n|m*n}end
x,y=gets.split.map{|n|n.to_i}
p g(x)/(g(y)*g(x-y))

Tagged: ruby, code golf


Leave a comment:




© 2010 Travis Roberts. All rights reserved.