kt: add «58. Length of Last Word»
URL: https://leetcode.com/problems/length-of-last-word/ Signed-off-by: Matej Focko <me@mfocko.xyz>
This commit is contained in:
parent
a28c619756
commit
1f6394137d
1 changed files with 3 additions and 0 deletions
3
kt/length-of-last-word.kt
Normal file
3
kt/length-of-last-word.kt
Normal file
|
@ -0,0 +1,3 @@
|
|||
class Solution {
|
||||
fun lengthOfLastWord(s: String): Int = s.trim().split(Regex("\\s+")).last().length
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue