# Pls help me with this basic exercise

**URL:** <https://discuss.kotlinlang.org/t/pls-help-me-with-this-basic-exercise/17378>\
**Category:** Uncategorized\
**Created:** [April 28, 2020, 2:25am UTC](https://discuss.kotlinlang.org/t/pls-help-me-with-this-basic-exercise/17378 "2020-04-28T02:25:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juanmrbnero](https://avatars.discourse-cdn.com/v4/letter/j/50afbb/32.png) [@Juanmrbnero](https://discuss.kotlinlang.org/u/Juanmrbnero)\
**Post date:** [April 28, 2020, 2:25am UTC](https://discuss.kotlinlang.org/t/pls-help-me-with-this-basic-exercise/17378/1 "2020-04-28T02:25:31Z")

</div>

Im trying to do the exercise from

> **[Compare the Triplets | HackerRank](https://www.hackerrank.com/challenges/compare-the-triplets/problem?h_r=next-challenge&h_v=zen)**
>
> Compare the elements in two triplets.

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]}”)

}

---

<div class="post-metadata">

**Author:** ![tieskedh](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/tieskedh/32/2816_2.png) [@tieskedh](https://discuss.kotlinlang.org/u/tieskedh)\
**Post date:** [May 1, 2020, 1:09pm UTC](https://discuss.kotlinlang.org/t/pls-help-me-with-this-basic-exercise/17378/2 "2020-05-01T13:09:01Z")

</div>

1. 3…3 is incorrect, what should it be? [https://kotlinlang.org/docs/reference/ranges.html#ranges-and-progressions](https://kotlinlang.org/docs/reference/ranges.html#ranges-and-progressions)

2. `in` is a protected keyword. How can you write it? [https://kotlinlang.org/docs/reference/java-interop.html#escaping-for-java-identifiers-that-are-keywords-in-kotlin](https://kotlinlang.org/docs/reference/java-interop.html#escaping-for-java-identifiers-that-are-keywords-in-kotlin)

3. you don’t use the reader you just created, remove it.

4. if the code below would be written correctly (see 1), what does the following code print and why?

If you need more help, just ask.
