| Name | Language | Tokens Sum | Tokens Part 1 | Tokens Part 2 | Last change | |
|---|---|---|---|---|---|---|
| 1 | Python | 249 | 108 | 141 | 21 months ago |
fromcollectionsimportCounterdefsort_by(cards_and_bid): types=[c[1]forcinCounter(cards_and_bid[0].replace("J","")).most_common()]or[0] types[0]+=cards_and_bid[0].count("J") returntypes,['J23456789TQKA'.index(card)forcardincards_and_bid[0]]print(sum(i*int(bid)fori,(cards,bid)inenumerate(sorted([line.split()forlineinopen(0)],key=sort_by),1)))