Name | Language | Tokens Sum | Tokens Part 1 | Tokens Part 2 | Last change | |
---|---|---|---|---|---|---|
1 | LiquidFun | Python | 146 | 88 | 58 | 11 months ago |
2 | anonymous | Kotlin | 227 | 123 | 104 | 12 months ago |
3 | Mustafa Furkan Kaptan | Python | 313 | 170 | 143 | 11 months ago |
4 | Valentin Slawicek | Kotlin | 404 | 221 | 183 | 11 months ago |
5 | CornerMercury | Python | 10059 | - | 59 | 3 days ago |
data
class
Grab
(
val
red
:
Int
,
val
green
:
Int
,
val
blue
:
Int
)
fun
main
(
)
=
println
(
generateSequence
(
::
readLine
)
.
sumOf
{
line
->
// Parse input
val
games
=
line
.
substringAfter
(
"
:
"
)
.
split
(
"
;
"
)
.
map
{
gameString
->
val
red
=
gameString
.
substringBefore
(
"
r
e
d
"
)
.
substringAfterLast
(
"
"
)
.
toIntOrNull
(
)
?:
0
val
green
=
gameString
.
substringBefore
(
"
g
r
e
e
n
"
)
.
substringAfterLast
(
"
"
)
.
toIntOrNull
(
)
?:
0
val
blue
=
gameString
.
substringBefore
(
"
b
l
u
e
"
)
.
substringAfterLast
(
"
"
)
.
toIntOrNull
(
)
?:
0
return@
Grab
(
red
,
green
,
blue
)
}
return@
games
.
maxOf
{
it
.
red
}
*
games
.
maxOf
{
it
.
green
}
*
games
.
maxOf
{
it
.
blue
}
}
)