Name | Language | Tokens Sum | Tokens Part 1 | Tokens Part 2 | Last change | |
---|---|---|---|---|---|---|
1 | ![]() |
Python | 180 | 57 | 123 | 8 months ago |
2 | Python | 188 | 71 | 117 | 8 months ago | |
3 | Python | 202 | 70 | 132 | 8 months ago | |
4 | Kotlin | 523 | 233 | 290 | 8 months ago |
from
collections
import
deque
t
=
0
cards
=
[
]
try
:
while
True
:
w
,
o
=
map
(
str
.
split
,
input
(
)
[
9
:
]
.
split
(
"
|
"
)
)
t
+=
1
cards
.
append
(
len
(
{
*
o
}
&
{
*
w
}
)
)
except
:
q
=
deque
(
)
i
=
0
for
c
in
cards
:
i
+=
1
q
+=
range
(
i
,
i
+
c
)
while
q
:
t
+=
1
i
=
q
.
popleft
(
)
+
1
q
+=
range
(
i
,
i
+
cards
[
i
-
1
]
)
print
(
t
)