Sum the two largest digits.

Are those digits to be unique?

Do it both ways.


In [1]:
# make a big number with many digits
s = list(str(2**100))

In [2]:
sorted(s)[-10:]


Out[2]:
['6', '6', '6', '6', '7', '7', '7', '8', '9', '9']

In [3]:
# non-unique
sum(sorted(map(int, s), reverse=True)[:2])


Out[3]:
18

In [4]:
# unique
sum(sorted(map(int, set(s)), reverse=True)[:2])


Out[4]:
17