aebe8c36f5
Uncommon means mostly that aren't present in raw fir builder data
10 lines
293 B
Kotlin
Vendored
10 lines
293 B
Kotlin
Vendored
fun <T> copyWhenGreater(list: List<T>, threshold: T): List<String>
|
|
where T : CharSequence,
|
|
T : Comparable<T> {
|
|
return list.filter { it > threshold }.map { it.toString() }
|
|
}
|
|
|
|
fun main() {
|
|
val list = listOf("1", "2", "3")
|
|
val copy = copyWhenGreater(list, "2")
|
|
} |