Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
With cmp_to_key solution in Clear category for Bigger Together by mindaugas.dadurkevicius
from functools import cmp_to_key
def cust_cmp(a, b):
return int(a+b)-int(b+a)
def bigger_together(ints):
ints = list(map(str, ints))
max_n = int(''.join(sorted(ints, key = cmp_to_key(cust_cmp), reverse=True)))
min_n = int(''.join(sorted(ints, key = cmp_to_key(cust_cmp))))
return max_n - min_n
June 23, 2021