Why am i getting a type mismatch error in my kotlin function?
Example:
fun greet(name: String): Int {
return "Hello, $name"
}
Solution:
fun greet(name: String): String { // Fixed the return type
return "Hello, $name"
}
Ensure that the function's return type matches the actual return value's type.