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