Given a string s made up of English letters and space characters, return the length of the last word in s. A word is a maximal contiguous sequence of English letters. Trailing spaces in s should not be considered part of the last word.
Note:
sis guaranteed to contain at least one word.
Constraints:
s.length
s consists of only English letters and spaces ' '
There will be at least one word in s
Given a string s made up of English letters and space characters, return the length of the last word in s. A word is a maximal contiguous sequence of English letters. Trailing spaces in s should not be considered part of the last word.
Note:
sis guaranteed to contain at least one word.
Constraints:
s.length
s consists of only English letters and spaces ' '
There will be at least one word in s