Name | Language | Tokens Sum | Tokens Part 1 | Tokens Part 2 | Last change | |
---|---|---|---|---|---|---|
1 | Python | 249 | 108 | 141 | 8 months ago |
from
collections
import
Counter
sort_by
=
lambda
cards
:
(
[
c
[
1
]
for
c
in
Counter
(
cards
[
0
]
)
.
most_common
(
)
]
,
[
'
2
3
4
5
6
7
8
9
T
J
Q
K
A
'
.
index
(
card
)
for
card
in
cards
[
0
]
]
)
print
(
sum
(
i
*
int
(
bid
)
for
i
,
(
cards
,
bid
)
in
enumerate
(
sorted
(
[
line
.
split
(
)
for
line
in
open
(
0
)
]
,
key
=
sort_by
)
,
1
)
)
)