Name | Language | Tokens Sum | Tokens Part 1 | Tokens Part 2 | Last change | |
---|---|---|---|---|---|---|
1 | Sharparam | Ruby | 148 | 36 | 112 | 11 months ago |
2 | Visible-Bag4062 | Python | 208 | 45 | 163 | 11 months ago |
3 | Mustafa Furkan Kaptan | Python | 209 | 43 | 166 | 11 months ago |
4 | Valentin Slawicek | Kotlin | 212 | 52 | 160 | 11 months ago |
5 | LiquidFun | Python | 217 | 56 | 161 | 10 months ago |
6 | GXgaetjen | Kotlin | 232 | 78 | 154 | 11 months ago |
7 | anonymous | Kotlin | 261 | 60 | 201 | 11 months ago |
8 | Visible-Bag4062 | C++ | 290 | 74 | 216 | 11 months ago |
9 | Mathias Parger | Python | 348 | 129 | 219 | 11 months ago |
10 | abnew123 | Java | 527 | 189 | 338 | 11 months ago |
11 | Kevin Brasier | Python | 10043 | 43 | - | 11 months ago |
12 | Nolan Locke | Kotlin | 10048 | 48 | - | 11 months ago |
13 | 0bArcane | Python | 10067 | 67 | - | 11 months ago |
14 | Visible-Bag4062 | Java | 10115 | 115 | - | 11 months ago |
import
java
.
util
.
*
;
public
class
Main
{
public
static
void
main
(
String
[
]
args
)
{
Scanner
in
=
new
Scanner
(
System
.
in
)
;
int
answer
=
0
;
List
<
String
>
lines
=
new
ArrayList
<
>
(
)
;
while
(
in
.
hasNext
(
)
)
{
lines
.
add
(
in
.
nextLine
(
)
)
;
}
for
(
String
line
:
lines
)
{
answer
+=
10
*
helper
(
line
,
true
)
;
answer
+=
helper
(
line
,
false
)
;
}
System
.
out
.
println
(
answer
)
;
}
private
static
int
helper
(
String
line
,
boolean
forwards
)
{
String
[
]
digits
=
new
String
[
]
{
"
o
n
e
"
,
"
t
w
o
"
,
"
t
h
r
e
e
"
,
"
f
o
u
r
"
,
"
f
i
v
e
"
,
"
s
i
x
"
,
"
s
e
v
e
n
"
,
"
e
i
g
h
t
"
,
"
n
i
n
e
"
}
;
char
[
]
chars
=
line
.
toCharArray
(
)
;
for
(
int
i
=
0
;
i
<
chars
.
length
;
i
++
)
{
int
index
=
forwards
?
i
:
(
chars
.
length
-
i
-
1
)
;
for
(
int
j
=
0
;
j
<
digits
.
length
;
j
++
)
{
if
(
index
+
digits
[
j
]
.
length
(
)
>
line
.
length
(
)
)
{
continue
;
}
String
substring
=
line
.
substring
(
index
,
index
+
digits
[
j
]
.
length
(
)
)
;
if
(
substring
.
contains
(
digits
[
j
]
)
)
{
return
j
+
1
;
}
}
char
ch
=
chars
[
index
]
;
if
(
Character
.
isDigit
(
ch
)
)
{
return
Character
.
digit
(
ch
,
10
)
;
}
}
return
-
1
;
}
}