Name | Language | Tokens Sum | Tokens Part 1 | Tokens Part 2 | Last change | |
---|---|---|---|---|---|---|
1 | CornerMercury | Python | 290 | 145 | 145 | 38 days ago |
2 | dbasden | Python | 307 | 137 | 170 | 38 days ago |
3 | Mechazawa | JavaScript | 10143 | 143 | - | 37 days ago |
i
=
require
(
'
f
s
'
)
.
readFileSync
(
0
,
'
u
t
f
8
'
)
disk
=
[
]
;
id
=
0
;
z
=
(
a
,
v
)
=>
{
for
(
i
=
0
;
i
<
a
;
i
++
)
disk
.
push
(
v
)
}
for
(
const
[
_
,
a
,
b
=
0
]
of
i
.
matchAll
(
/
(\d)(\d?)
/
g
)
)
{
z
(
a
,
id
++
)
z
(
b
,
null
)
}
while
(
(
Z
=
disk
.
indexOf
(
null
)
)
>=
0
)
disk
[
Z
]
=
disk
.
pop
(
)
;
console
.
log
(
disk
.
reduce
(
(
a
,
c
,
i
)
=>
a
+
c
*
i
,
0
)
)
;