Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Min and Max by sebastian.okseniuk
def max_or_min(args, kwargs):
key = kwargs.get('key', None)
reverse = kwargs.get('reverse', False)
if len(args) == 1:
args = args[0]
return sorted(args, key=key, reverse=reverse)[0]
def min(*args, **kwargs):
return max_or_min(args, kwargs)
def max(*args, **kwargs):
kwargs.update(reverse=True)
return max_or_min(args, kwargs)
Dec. 14, 2015