My LeetCode grinding. Trying to do a problem a day.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

problem.txt 381B

12345678910
  1. Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word (last word means the last appearing word if we loop from left to right) in the string.
  2. If the last word does not exist, return 0.
  3. Note: A word is defined as a maximal substring consisting of non-space characters only.
  4. Example:
  5. Input: "Hello World"
  6. Output: 5