Cannot run Kotlin code

fun main() {
repeat(ri()) {
val n = ri()
val s = r()
val a = s.toSortedSet()
println(a.first())
}
}

private fun ria() = r().split(" ").map { it.toInt() }
private fun ri() = r().toInt()
private fun r() = readLine()!!

when I try to run this it gives NZEC and no main manifest attribute, in prog.jar
please help

On CodeChef, we still have Kotlin 1.2 running. So, you necessarily need to write your main method like this:

fun main(args: Array<String>) {
    // code...
}

Since Kotlin 1.3, we got this freedom to write main method even without a command line argument list. So, for this feature, we’ll have to wait for CodeChef to update Kotlin to 1.3 or later (1.4 is the latest, as of now).
@admin

Hope it helps!

1 Like

Thank you very much! That worked :grin:

1 Like

How long we have to wait for it? cause now v1.5.10 is released in kotlin and CodeChef still uses 1.2 many features and functions are not available

Hmm. True that. Only @admin can tell.