My LeetCode grinding. Trying to do a problem a day.
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

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