You have one string in standard input — it is a sequence of numbers and strings split by spaces. Filter the numbers only, create a list of Int from this string and return the max element or null if the list is empty. Tip: you have to check the characters or use the toIntOrNull() function. You can read about this function in the documentation.
Null and collections
I'm the biggest one!
Report a typo
Sample Input 1:
12 4.00 Kraken pull push 43 12345 cat powerSample Output 1:
12345Write a program in Kotlin
fun main() {
// Write your code here
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.