Name | Language | Tokens Sum | Tokens Part 1 | Tokens Part 2 | Last change | |
---|---|---|---|---|---|---|
1 | Frederik Bonfanti | Ruby | 196 | 95 | 101 | 7 days ago |
puts
(
ARGF
.
read
.
split
(
"
\n
\n
"
)
.
sum
do
x1
,
y1
,
x2
,
y2
,
x
,
y
=
_1
.
scan
(
/
\d
+
/
)
.
map
&
:to_i
div
=
x1
*
y2
-
x2
*
y1
a
=
(
x
*
y2
-
x2
*
y
)
/
div
b
=
(
x1
*
y
-
x
*
y1
)
/
div
next
0
unless
a
*
x1
+
b
*
x2
==
x
3
*
a
+
b
end
)