Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Bigger Together by twilyght
def bigger_together(ints):
"""
Returns difference between the largest and smallest values
that can be obtained by concatenating the integers together.
"""
max_digits = max(len(str(i)) for i in ints)
sort_key = lambda n: str(n) * max_digits
asc = int(''.join(map(str, sorted(ints, key=sort_key))))
desc = int(''.join(map(str, sorted(ints, key=sort_key, reverse=True))))
return desc - asc
June 9, 2020