What is the result of this code?
val names = listOf("Alice", "Bob", "Carol", "Dave", "Eve")
val sum = names.fold(0) { acc, name ->
if (name.length >= 3) acc + name.length else acc
}What is the result of this code?
val names = listOf("Alice", "Bob", "Carol", "Dave", "Eve")
val sum = names.fold(0) { acc, name ->
if (name.length >= 3) acc + name.length else acc
}Create a free account to access the full topic