← 返回 bytedance 的题目列表Length of Last Word
类型:online_judge
Given a string s consists of some words separated by spaces, return the length of the last word in the string. If the last word does not exist, return 0.
Examples:
Input: "Hello World"
Output: 5
Input: " "
Output: 0
Note: The string will be trimmed according to need.
Example
Input
"Hello World"