Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Bigger Together solution in Creative category for Bigger Together by vvm70
from itertools import permutations as prm
def bigger_together(ints):
lst = [[str(x) for x in ints if i == str(x)[0]] for i in set(x[0] for x in map(str, ints))]
return int(''.join(sorted(map(str, (max(int(''.join(x)) for x in prm(y, len(y))) for y in lst)))[::-1])) - int(''.join(sorted(map(str, (min(int(''.join(x)) for x in prm(y, len(y))) for y in lst)))))
if __name__ == '__main__':
#These "asserts" using only for self-checking and not necessary for auto-testing
assert bigger_together([1,2,3,4]) == 3087, "4321 - 1234"
assert bigger_together([1,2,3,4, 11, 12]) == 32099877, "43212111 - 11112234"
assert bigger_together([0, 1]) == 9, "10 - 01"
assert bigger_together([100]) == 0, "100 - 100"
print('Done! I feel like you good enough to click Check')
May 22, 2020