mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-13 08:31:31 +00:00
7 lines
176 B
Kotlin
Vendored
7 lines
176 B
Kotlin
Vendored
|
|
fun Int.isOdd() = (this % 2) == 1
|
|
val list: List<Pair<Int, String>> = listOf(1 to "a", 2 to "b")
|
|
val (odds, evens) = list.partition { (i, _) -> i.isOdd() }
|
|
println(odds)
|
|
odds
|