Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Min and Max by re-24
def min(*args, key=None):
return get_sorted(args, key, False)
def max(*args, key=None):
return get_sorted(args, key, True)
def get_sorted(args, key=None, reverse=False):
if len(args) == 1:
sorted_args = sorted(args[0], key=key, reverse=reverse)
else:
sorted_args = sorted(args, key=key, reverse=reverse)
return sorted_args[0]
Sept. 11, 2017