mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
12 lines
291 B
Kotlin
Vendored
12 lines
291 B
Kotlin
Vendored
operator fun Array<String>.get(index1: Int, index2: Int) = this[index1 + index2]
|
|
operator fun Array<String>.set(index1: Int, index2: Int, elem: String) {
|
|
this[index1 + index2] = elem
|
|
}
|
|
|
|
fun box(): String {
|
|
val s = Array<String>(1, { "" })
|
|
s[1, -1] = "OK"
|
|
return s[-2, 2]
|
|
}
|
|
|