How to pass a function as a parameter to another function in Kotlin?
Hi! I just started learning Kotlin after Java, and I have a problem. In Java, I was used to passing functions through interfaces or lambdas, but in Kotlin everything is somehow different. Let's say I have a simple function that adds two numbers:
```kotlin
fun add(a: Int, b: Int): Int {
return a + b
}
```
And I want to pass it to another function that will apply it to a pair of numbers and print the result. I tried to write something like:
```kotlin
fun applyOperation(x: Int, y: Int, operation: ???) {
val result = operation(x, y)
println("Result: $result")
}
```
But I don't know what type to specify for the `operation` parameter. I've heard something about `Function` or `(Int, Int) -> Int`, but I'm not sure how to use it correctly. I'm also curious if it's possible to pass func