In Kotlin
Array<Int>
is a Integer[]
under the hood, and IntArray
is an int[]
(more info here). Not sure if it will help in this case but does changing c
to c.toIntArray()
on the last line solve the problem?