How can I apply a condition on a lambda expression in kotlin?
I want to apply a condition using higher-order infix extension function on a list of pair.
I want my condition to show me the first numbers of the pair. Specifically, show those first numbers whose sum with their second number is 5.
T
this is the code I have written so far
fun main() {
infix fun List.takeFirstsBy(
condition: // i need help in this line to apply a condition on list of pair
):List{
}
}
I don't know how to write a conditional...