Secret code to save the city

Report a typo

Ethan Hunt is ready for another "Mission: Impossible". To disable a chemical weapon, he must type the correct code. He only knows that the code is obtained in the following way: "using a secret operator on a list of strings, you must obtain the sum of the lengths of all the words whose length exceeds the limit indicated". Please help Ethan print the value and save us again.

val listOfWords = listOf("expetum", "axio", "lithigum", "anima", "milonga")
println(listOfWords secret 5)

Sample Input 1:

expetum axio lithigum magnum anima

Sample Output 1:

21
Write a program in Kotlin
// complete the definition
/*?*/.secret(limit: Int): Int {
// write the rest of the code
}
___

Create a free account to access the full topic