mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
16 lines
252 B
Kotlin
Vendored
16 lines
252 B
Kotlin
Vendored
// WITH_RUNTIME
|
|
|
|
fun contains(set: Set<Any>, x: Int): Boolean = when {
|
|
set.size == 0 -> false
|
|
else -> x in set as Set<Int>
|
|
}
|
|
|
|
fun box(): String {
|
|
val set = setOf(1)
|
|
if (contains(set, 1)) {
|
|
return "OK"
|
|
}
|
|
|
|
return "Fail"
|
|
}
|