def max_by(lst, fn):
  return max(map(fn, lst))