You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#!kotlin
fun bestHighJump(jumps: String): Int {
var parts=jumps.split(" ")
var result= mutableListOf<Int>()
try {
for (i in 0 until parts.size) {
if (parts[i]=="%-" || parts[i]=="%%-" || parts[i]=="-" || parts[i]=="%") continue
else if (parts[i]=="+" || parts[i]=="%+" || parts[i]=="%%+") result.add(parts[i-1].toInt())
}
} catch (e: NumberFormatException) {
return -1
}
return if (result.isEmpty()) -1
else result.max()!!
}
Now it looks like a right decision according to the tests although different winning cases will be ommited.
The text was updated successfully, but these errors were encountered:
Original report by Inga Egorova (Bitbucket: Rye_eyes, GitHub: Suntrie).
Now it looks like a right decision according to the tests although different winning cases will be ommited.
The text was updated successfully, but these errors were encountered: