Name | Language | Tokens Sum | Tokens Part 1 | Tokens Part 2 | Last change | |
---|---|---|---|---|---|---|
1 | Sharparam | Ruby | 120 | 60 | 60 | 11 months ago |
2 | LiquidFun | Python | 134 | 64 | 70 | 10 months ago |
3 | FSFabian Schedler | Kotlin | 158 | 77 | 81 | 11 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
)
.
extrapolate
(
)
}
)