Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
min, max = from_cmp(le), from_cmp(ge) solution in Creative category for Min and Max by flpo
from functools import reduce
from operator import le, ge
def from_cmp(cmp):
return lambda *args, key=lambda x: x: reduce(
lambda x, y: x if cmp(key(x), key(y)) else y,
args if len(args) > 1 else args[0])
min, max = from_cmp(le), from_cmp(ge)
Sept. 25, 2017