Name | Language | Tokens Sum | Tokens Part 1 | Tokens Part 2 | Last change | |
---|---|---|---|---|---|---|
1 | Sharparam | Ruby | 134 | 80 | 54 | 11 months ago |
times
,
distances
=
$<
.
readlines
.
map
{
_1
.
scan
(
/
\d
+
/
)
.
map
(
&
:to_i
)
}
puts
times
.
zip
(
distances
)
.
reduce
(
1
)
{
|
total
,
(
time
,
distance
)
|
total
*
(
0
..
time
)
.
find
{
(
time
-
_1
)
*
_1
>
distance
}
.
then
{
time
-
2
*
_1
+
1
}
}