mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-16 08:31:35 +00:00
15 lines
354 B
Kotlin
Vendored
15 lines
354 B
Kotlin
Vendored
import java.util.ArrayList
|
|
|
|
operator fun ArrayList<String>.get(index1: Int, index2: Int) = this[index1 + index2]
|
|
operator fun ArrayList<String>.set(index1: Int, index2: Int, elem: String) {
|
|
this[index1 + index2] = elem
|
|
}
|
|
|
|
fun box(): String {
|
|
val s = ArrayList<String>(1)
|
|
s.add("")
|
|
s[1, -1] = "O"
|
|
s[2, -2] += "K"
|
|
return s[2, -2]
|
|
}
|