it's worth pointing out that "max" and "min" are methods of the
enumerable module which is included in the array class. They will work with far more than just 2 values
max and min assumes that the objects in the enumerable implement
Comparable you can also pass max/min a block that works just like sort
array.max { |a, b| a.length <=> b.length }
the <=> (spaceship) operator is special comparison in that instead of returning true or false if one object is bigger than another it returns 1, 0, or -1 if the first object is bigger, equal to, or smaller than the second respectively. you do not need to use the <=> in the block you pass its just a convince. The block simply needs to return 1 if a>b, 0 if a==b, or -1 if a<b.