Im trying to do the exercise from
I already wrote the code and by my eyes it looks all good but the result is wrong and Idk why
thx
import java.util.Scanner
fun main(){
var loop = 0
var score = Array(2){0}
val reader = Scanner(System.in
)
var alice:String = readLine().toString()
var bob:String = readLine().toString()
val numerosa: List = alice.split(" “)
val numerosb:List = bob.split(” ")
for(a in 3…3) {
when (numerosa[loop].toInt()) {
in numerosb[loop].toInt() + 1..100 -> score[0] += 1
in numerosb[loop].toInt() - 1..0 -> score[1] += 1
}
loop += 1
}
println(“${score[0]} ${score[1]}”)
}