Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Simple solution in Clear category for Min and Max by altarfinch
import operator
def checkio(comp, *args, **kwargs):
key = kwargs.get("key", None)
if len(args) == 1: args = list(args[0])
m = args[0]
for v in args:
if key and comp(key(v),key(m)) or not key and comp(v,m):
m = v
return m
min = lambda *args, **kwargs:checkio(operator.lt, *args, **kwargs)
max = lambda *args, **kwargs:checkio(operator.gt, *args, **kwargs)
Feb. 10, 2015
Comments: