Name | Language | Tokens Sum | Tokens Part 1 | Tokens Part 2 | Last change | |
---|---|---|---|---|---|---|
1 | Ruby | 120 | 60 | 60 | 8 months ago | |
2 | Python | 134 | 64 | 70 | 8 months ago | |
3 | FSFabian Schedler | Kotlin | 158 | 77 | 81 | 9 months ago |
fun
List
<
Int
>
.
extrapolate
(
)
:
Int
=
if
(
all
{
it
==
0
}
)
0
else
last
(
)
+
zipWithNext
{
a
,
b
->
b
-
a
}
.
extrapolate
(
)
fun
main
(
)
=
println
(
generateSequence
(
::
readLine
)
.
sumOf
{
it
.
split
(
"
"
)
.
map
(
String
::
toInt
)
.
reversed
(
)
.
extrapolate
(
)
}
)