My LeetCode grinding. Trying to do a problem a day.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

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