The smallest smallest
In Ruby:
def smallest a, b=nil, *c b ? smallest( (a<b ? a : b), *c ) : a end smallest(9,8,5,2,3) # is 2Can anyone do better?
no subject
Then again, yours is O(n) versus my O(n log n)
no subject