URL: https://leetcode.com/problems/length-of-last-word/ Signed-off-by: Matej Focko <me@mfocko.xyz>
3 lines
106 B
Kotlin
3 lines
106 B
Kotlin
class Solution {
|
|
fun lengthOfLastWord(s: String): Int = s.trim().split(Regex("\\s+")).last().length
|
|
}
|